Course map
Stage 1: Foundation
Stage 2: Intermediate
Stage 3: Advanced
Stage 4: DSA in Python
Stage 5: Specialization

Part 01 / Topic 3 of 7

VS Code + Python extension

VS Code is a free code editor. With the Python extension (by Microsoft) you get colours, auto-complete, a Run button and error hints.

Real-world example: You want to write, run and fix code in one window.

Steps:

  1. Install VS Code from code.visualstudio.com.
  2. Open VS Code → Extensions (Ctrl+Shift+X, macOS: Cmd+Shift+X) → search Python → Install.
  3. File → Open Folder → pick a folder like python-practice.
  4. Create hello.py, type code, press ▶️ Run Python File (top right).
  5. Bottom-right corner: click the Python version to pick your 3.13 interpreter.
Windows / Linux macOS What it does
Ctrl+Shift+P Cmd+Shift+P Command palette (search any action)
Ctrl+` Ctrl+` Open the terminal
Ctrl+/ Cmd+/ Comment / uncomment a line
Shift+Alt+F Shift+Option+F Format the file (needs a formatter extension, e.g. Black)

🧪 Quick quiz — answer from memory, then check.

  1. Which extension turns VS Code into a Python editor?
  2. Which shortcut opens the command palette?
Show the answers
  1. The Python extension by Microsoft.
  2. Ctrl+Shift+P (macOS: Cmd+Shift+P).

Done here? The practice set for Part 1 — 6 exercises with solutions — is on the part page.

Search the guide