Why start here
If you have written a spreadsheet formula, you have already programmed a little. You typed an instruction, pressed Enter, and the computer did it. Python works the same way, with two differences. The instructions live in a plain text file called a script, and a program called the Python interpreter reads that file from top to bottom and carries out each line.
By the end of this level you will have three things:
- Python 3.13 or later installed, with the version checked.
- VS Code set up as your editor.
- A one-line script that you have run twice, once from the editor and once from the terminal. You will also have broken it on purpose, so you can tell what an error looks like.
The current release is Python 3.15 (out 9 October 2026). Any version from 3.13 up is fine for this course, and the latest is the best choice.
Step 1: Install Python
Windows. Go to python.org/downloads and get the Python Install Manager, or install it from the Microsoft Store. It is now the recommended way to install Python on Windows. The old all-in-one installer has been deprecated since Python 3.14 and won't be made for 3.16 or later, so older tutorials may show screens you won't see. During setup you may be asked whether to add a folder to your PATH. Say yes, so the python command works from any terminal.
macOS. Download the .pkg installer from python.org/downloads/macos and run it. When it finishes, open /Applications/Python 3.15/ and double-click Install Certificates.command. Later scripts that call web APIs need it.
Now open a terminal (PowerShell on Windows, Terminal on macOS) and check what you installed:
# Windows
python --version
# Expected output, something like:
# Python 3.15.0
# Lists every Python version the Install Manager has installed
py list
# macOS: the command is python3, not python
python3 --version
# Python 3.15.0
Gotcha: If the version shown is lower than 3.13, an older Python on your machine is answering first. On macOS, always type
python3. On Windows, runpy listto see what is installed. Don't carry on until you see 3.13 or higher.
No install rights on a work laptop? A browser notebook such as Google Colab runs Python without installing anything. Be aware that Colab ran Python 3.12 through 2026, which is older than this course targets. That is fine for the early lessons, but a local install is better. To check the version, type !python --version in a cell.
Step 2: Install VS Code and the Python extension
Download VS Code from code.visualstudio.com and install it. Then:
- Open the Extensions panel (the icon made of four squares on the left).
- Search for Python and install the one published by Microsoft.
- Press
Ctrl+Shift+P(Cmd+Shift+Pon Mac), type Python: Select Interpreter, and choose the 3.13+ version you just installed.
The extension adds the Run button you'll use next. Selecting the interpreter tells VS Code which Python to run your code with. If you skip this, VS Code may quietly pick an old one.
Step 3: Write and save your first script
Make a folder for your work, for example Documents\python-work. In VS Code choose File > Open Folder and open it. Then create a new file named hello.py.
# hello.py: lines starting with # are comments; Python ignores them
print("Hello from Python!") # print() shows text in the terminal
Save with Ctrl+S. The .py ending matters: it tells VS Code and Python that this is a Python script. A file called hello.txt with the same text would not run.
Step 4: Run it two ways
From the editor. Click the Run Python File play button (▷) at the top right. A terminal panel opens at the bottom and shows:
Hello from Python!
VS Code also prints the full command it ran just above your output. That's normal.
From the terminal. Open a terminal inside VS Code with Ctrl+Shift+` and type:
python hello.py # Windows
# python3 hello.py # macOS
You get the same output. It's worth knowing both ways. The button is convenient, but the terminal is how you'll run scripts on a schedule, on a server or when a colleague asks how.
Gotcha:
python hello.pylooks for the file in the terminal's current folder. If you getcan't open file ... [Errno 2] No such file or directory, the terminal is in the wrong place. Change to your folder first withcd Documents\python-work.
Step 5: Break it on purpose
Professionals read errors every day, so it pays to learn now what one looks like. Change print to prin, save, and run again:
Traceback (most recent call last):
File "C:\Users\you\Documents\python-work\hello.py", line 2, in <module>
prin("Hello from Python!")
^^^^
NameError: name 'prin' is not defined. Did you mean: 'print'?
Here is how to read it:
Tracebackat the top means the script stopped with an error.- The
File ... line 2line tells you which file and which line to look at. - The
^^^^markers point at the part of the line Python is complaining about. - The last line names the problem. Recent versions often suggest a fix too (
Did you mean: 'print'?).
A successful run shows only your output, with no Traceback and no line ending in Error. Fix the typo, save and run once more to get back to a clean result.
Best practice: Always save before you run. Running an unsaved file is one of the most common reasons a beginner thinks their fix "didn't work".
Your exercise
Add a second line to hello.py that prints your name, for example print("Report script by Sam"). Run it from the terminal.
Check: you should see two lines of output and no Traceback. If you see an error, read its last line, find the line number it gives, fix that line and run again.
Key takeaways
- Check your version with
python --version(Windows) orpython3 --version(macOS). It must say 3.13 or higher. - On Windows, the Python Install Manager is now the recommended installer. The old installer is deprecated.
- A script is a plain text file ending in
.py. Save it before running. - Run a script with VS Code's Run Python File button, or with
python hello.pyin a terminal opened in the right folder. - No
Tracebackmeans success. If there is one, read the last line for the problem and theFile ... linepart for where it is.