Getting Started with Python on Windows
Whether you're new to programming or an experienced coder, setting up Python on your Windows machine is the first step toward writing powerful Python code. This guide will walk you through the simple steps of installing Python on your Windows operating system and ensuring that everything is ready for your coding journey.
Step 1: Download Python Installer
The first step is to download the latest version of Python. Here's how:
- Visit the official Python website: https://www.python.org/downloads/.
- On the homepage, you'll see a "Download" button that automatically suggests the version for your operating system. Click the button to start the download.
- If you want a specific version of Python, you can go to the "Downloads" section and select the version manually.

Step 2: Run the Installer
Once the installer has been downloaded, follow these steps:
- Locate the downloaded installer file, which will be named something like python-3.x.x.exe.
- Double-click the file to start the installation process.
Important:
- Make sure to check the box that says "Add Python to PATH" at the beginning of the installation. This is a crucial step that will allow you to run Python from the Command Prompt easily.
- Choose the "Install Now" option for a quick setup, or use the "Customize Installation" option if you want more control over the installation settings.

Step 3: Verify Python Installation
- Open the Command Prompt. You can do this by searching for "cmd" in the Start menu or by pressing Win + R, typing cmd, and pressing Enter.
- Type the following command and press Enter:If Python is correctly installed, you will see the version of Python displayed in the terminal, something like:
python --version
python --version
python 3.x.x
python 3.x.x
- If you see an error or message that Python is not recognized, it may mean that Python was not added to your PATH during installation. You can manually add it or reinstall and ensure the box is checked during the installation.
Step 4: Install a Code Editor
To write and run Python code, you'll need a code editor. While you can technically use any text editor like Notepad, we recommend using a dedicated code editor to make development easier and more efficient.
One of the most popular choices is:
- Visual Studio Code (VS Code): A lightweight, open-source code editor developed by Microsoft. It supports Python, includes debugging tools, Git integration, and many helpful extensions.
How to Install Visual Studio Code on Windows:
- Visit https://code.visualstudio.com and click the Download for Windows button.
- Once the installer is downloaded, double-click it and follow the on-screen instructions to complete the installation.
- After installation, open Visual Studio Code from your Start menu or desktop shortcut.

Install the Python Extension:
- Open VS Code.
- Click on the Extensions icon in the left sidebar (it looks like four squares).
- In the search bar at the top, type Python.
- Find the extension published by Microsoft and click Install.
- Once installed, VS Code will automatically detect your Python installation and provide suggestions for running and debugging Python code.

Step 5: Run Your First Python Script
Now that Python is installed, it’s time to write and run your very first Python program! Just follow these simple steps:
- Open your code editor (such as Visual Studio Code).
- Create a new file and name it something like
hello.py
. Make sure the file extension is.py
, which tells the system it’s a Python script. - In the new file, type the following code:python
print("Hello, world!")
print("Hello, world!")
- Save the file to a folder you can easily find, like
C:\Users\YourName\Documents
or your Desktop. - To run the script, you have two options:
- In VS Code, click the Run (▶️) button at the top-right corner of the editor window.
- Or, open the Command Prompt, navigate to the folder where your Python file is saved using the
cd
command, and run:python hello.py
python hello.py
- You should see this output:
Hello, world!
Hello, world!
- 🎉 Great job! You’ve just run your first Python program on Windows.
That's it! You’re all set to start coding in Python.
Happy coding!