Install Python and set it up with Visual Studio Code (VS Code)
Step 1: Install Python
1. Go to the official website:
[Link]
2. Click Download Python (latest version).
3. Run the installer.
4. Click Install Now
Now, Add Python to PATH:
Step 1: Find Python Installation Path
1. Open File Explorer
2. Go to:
C:\Users\YourUsername\AppData\Local\Programs\Python\
3. Open the folder like:
Python311 (or your version)
4. Copy these TWO paths:
Main Python path:
C:\Users\YourUsername\AppData\Local\Programs\Python\Python3
11\
Scripts path:
C:\Users\YourUsername\AppData\Local\Programs\Python\Python3
11\Scripts\
Step 2: Open Environment Variables
1. Press:
Windows + S
2. Search:
Environment Variables
3. Click:
Edit the system environment variables
4. Click:
Environment Variables
Step 3: Edit PATH
1. Under User variables, find:
Path
2. Select it → Click Edit
Step 4: Add Python Paths
1. Click New
2. Paste:
(your Python path)
3. Click New again and paste:
(Scripts path)
Step 5: Save
1. Click OK
2. Click OK again to close everything
Step 2: Verify Python Installation
1. Open Command Prompt (CMD)
2. Type:
python --version
3. If installed correctly, you’ll see something like:
Python 3.x.x
Step 3: Install VS Code
1. Go to:
[Link]
2. Download and install VS Code
3. Open VS Code after installation
Step 4: Install Python Extension in VS Code
1. Open VS Code
2. Click on Extensions icon (left sidebar)
3. Search: Python
4. Install extension by:
Microsoft (Python extension)
Step 5: Configure Python in VS Code
1. Open VS Code
2. Press:
Ctrl + Shift + P
3. Type:
Python: Select Interpreter
4. Choose the installed Python version
Step 6: Create and Run Your First Python File
1. Click File → New File
2. Save it as:
[Link]
3. Write this code:
4. print("Hello World")
5. Run the file:
o Click Run ▶ button, OR
o Right-click → Run Python File