The first step to learning Python is getting it to run on our machine. Python is really easy to set up on both Windows and Mac. Some newer systems already have python installed on them. To find out if we already have a version of Python, we open the command prompt (for Windows) or the terminal app (for Macs). Then enter the following
make sure to enter the “V” in caps. If the machine does have Python we should see something like this
If that doesn’t show up then we either don’t have it or we have it installed with a version number. We can then try
after which we might as well prepare for a quick and easy install.
The latest version for Python can be downloaded from python.org/download. After installation is complete, we can move to whichever folder we installed Python in and run the python.exe file. Typing exit() and hitting enter will close the Python shell.
There’s also the option of downloading Anaconda from anaconda.com/download. This is probably the easier alternative as we will be able to easily update our versions and also get access to a ton of packages that allow us to do cool stuff. Personally, I prefer this option.
If those don’t work out or you find yourself away from your machine, you can always find a python shell online. Some of them are pretty good too. I like to use them when I’ve written some terrible code (like the one time I tried getting something to work with recursion) that I feel would end in an infinite loop or a crash. That way I can just close the tab instead of restarting my IDE.
You can find some cool ones here:
Once all that’s settled, we can move on to writing our first bits of code with a Hello World program.