Series

Python foundations

If you've never written a line of code, start here. Five short lessons, in order, that take you from nothing to reading files, handling errors and writing functions you'd actually reuse. I've tried to assume as little as possible.

Your very first line of Python.

New to this? Perfect. Change the word in quotes, hit Run, and watch Python drop it into the sentence. Nothing to install — it runs right here in the page.

main.pyPython 3 · in your browser
You can't break anything.

The lessons, in order.

Each one builds on the last. Start at the top.

1 of 5

Your first 10 lines of Python

Variables, printing, and f-strings — the honest starting point. Ten lines, fully explained, nothing assumed.

2 of 5

Lists and loops: doing the same thing to many things

Working through a list of clients without repeating yourself twice, ten times, or two hundred times — the pattern behind almost every real script.

3 of 5

Functions: write the logic once, reuse it forever

Turning a calculation you'd otherwise copy and paste — like a fee estimate — into a single reusable block you can trust every time.

4 of 5

Reading error messages without panic

What Python's red text is actually telling you — and how three common errors turn from scary to boring once you know the pattern.

5 of 5

Working with files: reading and writing safely

The with open(...) pattern you'll use every time Python needs to read a client list or write out a summary — and why it's built to fail safely.

Free takeaway

The whole series, on one page.

Variables to files — every pattern from these lessons on a single page you can bookmark or print. No sign-up, no catch.

Get the cheat sheet →
Back to all writing →