Interactive course · 21 lessons · ~6.5 hours

Core Python: from your first line to real programs.

Python reads almost like English, which makes it easy to start and easy to pick up bad habits. This course builds the right mental model from day one: what a variable really is, how Python decides what is true, why some objects change and others never do, and how to organise code into functions, modules and classes. It ends with a complete command-line project with tests. Every example on these pages was run, and the output you see is the real output.

0 of 21 lessons complete0%

The one picture this course is built on

A Python program is a set of names pointing at objects, and code that creates, reads and changes those objects. Almost every beginner bug is a misunderstanding of one of these three things. Each module adds one layer.

names → objects price = 19.99 cart = ["tea", "rice"] Module 1 · lessons 03–06 control flow & collections for item in cart: if item in stock: … Module 2 · lessons 07–10 functions & modules def total(cart): … from shop import total Module 3 · lessons 11–13 files, errors & the standard library with open("sales.csv") as f: … except ValueError: … Module 4 · lessons 14–16 classes, testing & style class Expense: … def test_total(): assert … Modules 5–6 · lessons 17–21
Who this is for

Complete beginners, people who learned some Python by copying snippets and want the foundations properly, and developers coming from another language. You need no prior experience. You need Python 3.12 or newer (lesson 02 shows how to install it).

Core Python or Advanced Python?

Core Python (this course)Advanced Python
GoalWrite correct, readable programs with confidenceUnderstand how the language works underneath
Examplesvariables, strings, loops, lists, dicts, functions, files, classes, pytest basicsCPython bytecode, decorators, generators, descriptors, metaclasses, the GIL, asyncio
Start here if…you are new, or self-taught with gapsyou are comfortable with everything in the left column

Pick a path

~2 hours

Never programmed before

Lessons 01–07 in order, typing every example yourself. Then take a break and come back for the rest.

~2 hours

I know another language

Lessons 03, 05, 06, 08–11, 15, 17. The places where Python differs from Java, C# or JavaScript.

~1.5 hours

Self-taught, filling gaps

Lessons 03, 04, 08, 11, 14, 15, 20. Names vs objects, floats, copying, mutable defaults, files and errors.

~2 hours

Just build something

Lesson 21, the project, then look up whatever lesson each part links to.

Ships with a hands-on project

🛠 An expense tracker for the command line

A real tool built only with the standard library. It imports 600 rows of messy bank-export CSV (odd dates, currency symbols, duplicates, blank categories), cleans and categorises them, stores them as JSON, and prints monthly reports and budget warnings through an argparse command-line interface. It is organised as a package of modules with classes and functions, and comes with a pytest suite.

Open the project →

The curriculum