Setting Up Your Lab 🔧
Ten minutes of setup buys you the real thing: Python on your own machine, an editor that helps you, and a folder that is yours.
You can skip this. For now.
Every example in Levels 1 and 2 runs in your browser with the ▶ button, and the Playground is a full editor with nothing to install. If you want to start learning in the next thirty seconds, go, and come back here when a lesson needs real files.
But do come back. Programming on your own machine, with your own files, is the moment this stops being a course and starts being a craft.
Step 1: get Python
The full walkthrough for each operating system, with screenshots' worth of detail, lives on the Setup Lab page. The short version:
| System | Do this | Then check |
|---|---|---|
| Windows | Install from python.org/downloads and tick 'Add python.exe to PATH' on the first screen | python --version |
| macOS | Install from python.org/downloads (the version Apple ships is old and not for your projects) | python3 --version |
| Linux | It is almost certainly already there | python3 --version |
You are looking for something like this:
$ python3 --version
Python 3.13.5
Anything 3.11 or newer is fine for this course. If you get "command not found", the Setup Lab has a section for exactly that, and it is nearly always the PATH checkbox on Windows.
On macOS and Linux, type python3. Plain python may not exist, or may point at something ancient. On Windows, plain python is correct. This course writes python3 and you should mentally drop the 3 if you are on Windows.
Step 2: get an editor
You can write Python in Notepad. You should not. A real editor gives you syntax colouring, tells you about mistakes as you type, and lets you run code without leaving the window.
- VS Code plus the official Python extension. The default choice, free, works everywhere, and every tutorial assumes it.
- PyCharm Community: heavier, free, more opinionated, excellent refactoring.
- Zed: very fast, newer, and (fun fact for the sister school) written in Rust.
Take VS Code if you have no opinion. You can change later; nobody will mind.
Step 3: your first real program
- Make a folder. In your terminal:
cd ~ mkdir python-school cd python-school - Open it in your editor. In VS Code: File, Open Folder, pick
python-school. Working with a folder open rather than a lone file is the habit that makes everything else work later. - Make a file called
hello.pyand type this into it. Type it, do not paste it. Your fingers learn things your eyes do not.name = "Guybrush Threepwood" print("Hello, world!") print(f"My name is {name} and I am a mighty programmer.")Hello, world! My name is Guybrush Threepwood and I am a mighty programmer. - Save it. Ctrl+S, or Cmd+S on a Mac. An unsaved file is why your change "did nothing".
- Run it from the terminal, standing in that folder:
$ python3 hello.py Hello, world! My name is Guybrush Threepwood and I am a mighty programmer.
That was it. That was the wall. Almost everyone who quits programming quits somewhere in the last five minutes: the install, the PATH, the folder, the 'command not found'. You are past it. Everything after this is just learning what to type.
What you actually installed
Three things arrived on your machine, and knowing which is which will save you later:
| Thing | What it is | You use it by |
|---|---|---|
python3 | The interpreter: the program that runs your programs | python3 myfile.py |
pip | The package installer: fetches other people's code from PyPI | pip install requests (Lesson 26) |
| The REPL | An interactive prompt for trying things one line at a time | typing python3 with no filename |
Try the third one now. Type python3 on its own:
>>> 2 + 2
4
>>> "Guybrush" * 3
'GuybrushGuybrushGuybrush'
>>> len("How appropriate. You fight like a cow.")
38
>>> exit()
That is the REPL: Read, Evaluate, Print, Loop. It is a calculator that speaks Python and
it is the single best tool for answering "wait, what does this do?". Professionals keep
one open all day. exit() leaves.
Do not pile everything into Documents. Make a folder per project, keep its code in it, and open that folder in your editor. When Lesson 26 introduces virtual environments, this habit is what makes them painless instead of mysterious.
If something went wrong
| Message | What it means | Fix |
|---|---|---|
command not found: python3 | The shell cannot find Python | Reinstall, ticking 'Add to PATH'. Close and reopen the terminal afterwards |
No such file or directory: 'hello.py' | You are in the wrong folder | ls to look, cd to move. See Base Camp 5 |
SyntaxError | A typo in your code | Read the line number it gives you, then the line above it. Lesson 10 makes this easy |
IndentationError | Stray spaces at the start of a line | Line up your code at the left margin unless it is inside a block |
The full troubleshooting list, per operating system, is on the Setup Lab page. Nothing you can hit here is unusual, and nothing is your fault.
Make it yours
Change hello.py so it prints your own name, and add a third line that prints how many years you have wanted to learn this. Run it again.
Reveal solution
name = "your name here"
years = 4
print("Hello, world!")
print(f"My name is {name}.")
print(f"I have wanted to do this for {years} years, which ends today.")
Hello, world!
My name is your name here.
I have wanted to do this for 4 years, which ends today.If it ran, you have a working lab. Level 1 starts now.
Live in the REPL for two minutes
Open python3 with no filename and work out, by experiment, what each of these does. Guess first, then run it.
17 // 5
17 % 5
2 ** 10
"ho" * 3
len("Monkey Island")Reveal solution
17 // 5 is 3 (division, throwing away the remainder). 17 % 5 is 2 (just the remainder). 2 ** 10 is 1024 (2 to the power of 10). "ho" * 3 is 'hohoho' (yes, multiplying text works). len("Monkey Island") is 13, counting the space.
You just learned five things by asking the machine instead of asking a person. That is the most valuable habit in this entire course.