In this short guide, you’ll see how to install Python on Windows 11 from scratch. You’ll also learn how to run a simple script in Python.
Steps to Install Python on Windows 11
Step 1: Download Python
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, and then follow the installation instructions.
Note that you may check the box to add Python to the Path to facilitate future installation of Python packages.
Add Python to PATH
Step 3: Run a script in Python
You can run a script in Python via the Python IDLE.
To do that, type “idle” in the Windows search bar. Then, click on the Python App that you just installed.
You’ll then see the “Shell” screen. Click on File and then select New File (alternatively, you may use the keyboard shortcut of Ctrl+N).
You’ll now see the “untitled” box, where you can write your Python script. For example, type/copy the following script to print the famous expression of “Hello World“:
print("Hello World")
Press F5 on your keyboard. You’ll now get a message to save your script – Press OK.
Choose a location where the Python file would be saved on your computer. You’ll also need to type a name for your file. For instance, type “my_script” for your file name.
Once you’re done, click on Save, and you’ll see the “Hello World” expression printed on your Python Shell:
Hello World
You my check the following guide for the steps to install a package in Python using PIP.