In this short guide, you’ll see how to download and install Python 3.9 from scratch. You’ll also learn how to run a simple code in Python.
Here are the steps that you may follow.
Steps to Download and Install Python 3.9 on Windows
Step 1: Download Python 3.9
To start, go to python.org/downloads and then click on the button to download the latest version of Python:
Step 2: Run the .exe file
Next, run the .exe file that you just downloaded:
Step 3: Install Python 3.9
You can now start the installation of Python by clicking on Install Now:
Note that depending on your needs, you may also check the box to add Python to the Path.
Your installation should now begin:
After a short period of time, your setup would be completed:
Congrats, you just installed Python on Windows!
Let’s now see how to run a simple code in Python.
Run a Code in Python
You can run a code in Python via the Python IDLE.
A quick way to find your Python IDLE on Windows is by clicking on the Start menu. You should then see the IDLE under “Recently added”
Once you click on the Python IDLE, you’ll see the Shell screen:
Click on File and then select New File (alternatively, you may use the keyboard shortcut of Ctrl+N):
You would now see the following “untitled” box, where you can type your Python code:
For example, type/copy the command below. This command will print the famous expression of “Hello World”
print ("Hello World")
This is how the syntax would look like in the “untitled” box:
Press F5 on your keyboard. You will then get the following message to save your code:
Choose a location where the Python file will be saved on your computer. You’ll also need to type a name for your file. For example, type “Test” for your file name:
Once you’re done, press Save, and you’ll then see the “Hello World” expression printed on your Python Shell: