CoursePython from Scratch to Intermediate · Course guide · part 1 of 75
Part 1 · Course guide

Python from Scratch to Intermediate

5 min read·14 Oct 2026

Learn to program in Python from the very first line, up to writing a small, tested package with classes, files and a command-line tool. No experience needed.

You build one thing: the records program for Booknook, the lending shelf in the corner of a café called Kettle and Page. Twenty-four donated books, six members, a two-week loan and a small late fee for the charity jar. You start by printing one book's details and finish with a command Amira, the owner, can run each morning to see what is out, who is late and what is owed. Booknook and its people are fictional and its loans are simulated; the books are real public-domain titles, and every lesson also opens with a real, cited case.

Who this course is for

Anyone who wants to write programs, starting from nothing. You need to be able to use a web browser and copy and paste. You do not need to know any maths beyond adding and multiplying.

You are...Start at
New to programmingModule 1, and go in order
Someone who has tried a little Python and got stuckModule 1 quickly, then Module 2; slow down at Module 5
Comfortable with variables, loops and listsModule 6 (functions)
Able to write functions, never built a packageModule 7
Confident with Python, weak on classes or testingModule 9, then Module 10

Every module's README lists what you need to know before starting it, so you can check whether it is safe to skip the one before. After this course, Module 1 of the AI Engineering course is a quick review rather than new material.

What you need

  • A Google account, to run code in Google Colab. Nothing to install, and nothing to pay.
  • No API keys and no accounts with any other service. The course never calls a language model.
  • Optionally, your own computer with Python 3.12, for the parts that happen in a terminal. One page shows how: course-guide/07-run-locally.md.

Setup takes about five minutes: course-guide/02-setup-colab.md.

The modules

#ModuleWhat you add to the shelfNeeds first
1Getting StartedOne book and one loan held in variables, printed as Amira's first shelf cardNothing
2Values, Types and OperatorsThe late fee in whole pence, capped at £3.00, with input() for the days lateModule 1
3Strings and TextTom's notebook lines cleaned by hand; a lined-up loan slip with f-stringsModule 2
4Decisions and LoopsTwelve loans labelled on time, due soon or overdue, and the fees totalledModule 3
5CollectionsThe full catalogue as a list of dictionaries; what is out, who has it, books per genreModule 4
6Functionsdue_date, days_late, is_overdue, late_fee and reminder_text, each checked with assertModule 5
7Modules, the Standard Library and PackagesThe booknook package (dates.py, fees.py, catalogue.py) with real datesModule 6
8Errors, Files and Debuggingstorage.py: the CSV and JSON files loaded, Tom's notebook parsed into a problem list, clean files savedModule 7
9Classes and Objectsmodels.py: Book, Member and Loan dataclasses and a Library that lends, returns and reportsModule 8
10Intermediate PythonA loan-history generator, a logging decorator, a safe-save context manager and 15 or more pytest testsModule 9
11CapstoneThe Booknook command-line tool, python -m booknook report, overdue, lend and return, tested, with a READMEModules 1 to 10

What you have at the end

One repository, booknook/: a Python package with eight modules, the four data files, a tests/ folder of pytest tests and a README. It reads the shelf's records, reports every faulty line in Tom's notebook instead of guessing, refuses a fourth book to a member who has three, works out fees the same way every time, and saves its files safely. The full layout is in course-guide/03-the-booknook-project.md.

How each lesson works

Every lesson is a walk through one Booknook example, one picture at a time:

  1. The situation: something Amira needs from the shelf.
  2. A real case, first: something that really happened, or a page of Python's own documentation, from a published source, cited.
  3. The idea: fifteen to thirty figures, one idea each, one running example.
  4. Run it: short code with a walkthrough of every line.
  5. Break it: an error you cause on purpose, and how to read it.
  6. In production: how working programmers use the idea.
  7. Check yourself: questions, one exercise with a check, key terms and sources.

Each module ends with a lab (a guided piece of the shelf) and an incident file (a real, published failure caused by the kind of mistake the module teaches you to avoid, replayed at Booknook and fixed). Every output shown in the course comes from a real run. More detail: course-guide/01-how-this-course-works.md.

The tools you will use

Python 3.12, the version Colab runs, and its standard library: datetime, pathlib, csv, json, collections, math, random, contextlib and others that come with every Python. One extra package, pytest, for testing in Module 10. Everything is open source and free.

Where other courses go deeper

This course stops at intermediate Python. For what comes next:

  • Async code, project tooling (uv, linters, pre-commit) and version control with Git: Module 1 of the AI Engineering course.
  • Using Python to build applications on language models: the AI Engineering and Large Language Models courses.

Course guide

FileRead it when
01-how-this-course-works.mdBefore your first lesson
02-setup-colab.mdBefore you run any code
03-the-booknook-project.mdTo meet the café, the people, the rules, the dates and the files you will build
06-shared-data.mdTo see the Booknook data every module reuses
07-run-locally.mdWhen you want Python on your own computer (Module 1 Lesson 2 and Module 7 Lesson 4 point here)
04-style-guide.mdOnly if you are writing or editing lessons
05-image-style-guide.mdOnly if you are drawing the course figures

The one idea

A program is a set of rules written so exactly that a computer can follow them, and tested so that you know it still does. The shelf has four rules: fourteen days, twenty pence a day, three pounds at most, three books each. By the end you can write them down that exactly.