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:
- Install VS Code from code.visualstudio.com.
- Open VS Code → Extensions (
Ctrl+Shift+X, macOS:Cmd+Shift+X) → search Python → Install. File → Open Folder→ pick a folder likepython-practice.- Create
hello.py, type code, press ▶️ Run Python File (top right). - 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.
- Which extension turns VS Code into a Python editor?
- Which shortcut opens the command palette?
Show the answers
- The Python extension by Microsoft.
Ctrl+Shift+P(macOS:Cmd+Shift+P).
Done here? The practice set for Part 1 — 6 exercises with solutions — is on the part page.