Overview
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.
What you will learn
- 75 written parts, yours for good
- 14h 40m of reading, measured not estimated
- Written for the introductory level
- Every future revision included
Prerequisites
- 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.
Curriculum
12 sections · 75 parts · 14h 40m1h 51m free to read · 12h 49m with the course
01Course guide6 parts · 52 min
- Python from Scratch to IntermediateFree5 min
- How This Course WorksFree6 min
- Setup: Google ColabFree9 min
- The Project: the Booknook ShelfFree9 min
- Shared Booknook DataFree16 min
- Running Python on Your Own ComputerFree7 min
02Module 1: Getting Started6 parts · 59 min
- Module 1: Getting StartedFree1 min
- Lesson 1: Your first program, a card for one bookFree14 min
- Lesson 2: Trying lines out and saving them as scriptsFree14 min
- Lesson 3: Values, and the names that hold themFree14 min
- Lab: Print Amira's first shelf cardFree10 min
- Incident: One wrong character loses a rocketFree6 min
03Module 2: Values, Types and Operators7 parts · 73 min
- Module 2: Values, Types and Operators1 min
- Lesson 1: Numbers and sums: what does Ben owe?14 min
- Lesson 2: Text, yes or no, and nothing at all14 min
- Lesson 3: Converting between types, from text to pence13 min
- Lesson 4: Asking questions and printing answers14 min
- Lab: The late-fee calculator for six loans11 min
- Incident: A stock index that chopped itself in half6 min
04Module 3: Strings and Text6 parts · 58 min
- Module 3: Strings and Text1 min
- Lesson 1: Strings up close, one character at a time14 min
- Lesson 2: String methods, the tools every string carries14 min
- Lesson 3: f-strings, putting values neatly into text13 min
- Lab: Clean Tom's notebook and print a slip10 min
- Incident: A guessed encoding turned text into Chinese6 min
05Module 4: Decisions and Loops6 parts · 69 min
- Module 4: Decisions and Loops1 min
- Lesson 1: Making decisions: is this loan overdue?16 min
- Lesson 2: for loops, the same steps for every loan16 min
- Lesson 3: while loops, and how to stop them16 min
- Lab: Label twelve loans and total the fees12 min
- Incident: One extra second made servers spin8 min
06Module 5: Collections7 parts · 86 min
- Module 5: Collections1 min
- Lesson 1: Lists, many values kept in order under one name15 min
- Lesson 2: Tuples and sets, fixed records and unique values16 min
- Lesson 3: Dictionaries, finding things by name instead of position15 min
- Lesson 4: Nested data and comprehensions, the whole catalogue17 min
- Lab: Answer what is out and who has it14 min
- Incident: Crafted keys slowed dictionaries to a crawl8 min
07Module 6: Functions6 parts · 65 min
- Module 6: Functions1 min
- Lesson 1: Defining functions, giving a piece of work a name15 min
- Lesson 2: Parameters, the different ways to pass values in17 min
- Lesson 3: Where names live, and functions as values15 min
- Lab: Five shelf functions, each checked with assert11 min
- Incident: Reused code trusted a missing safety check6 min
08Module 7: Modules, the Standard Library and Packages7 parts · 84 min
- Module 7: Modules, the Standard Library and Packages1 min
- Lesson 1: Modules and imports: the shelf rules in one file16 min
- Lesson 2: Numbers, chance and real dates from the standard library16 min
- Lesson 3: Paths and collections: files, tallies and groups15 min
- Lesson 4: pip and virtual environments, packages kept per project13 min
- Lab: The booknook package, on real dates16 min
- Incident: A trusted package changed hands7 min
09Module 8: Errors, Files and Debugging7 parts · 94 min
- Module 8: Errors, Files and Debugging1 min
- Lesson 1: Errors and exceptions, reading them and catching them15 min
- Lesson 2: Reading and writing files that outlast your program16 min
- Lesson 3: Tables and records in CSV and JSON files17 min
- Lesson 4: Debugging: finding what is wrong, step by step17 min
- Lab: Load the shelf's files and check Tom's notebook20 min
- Incident: A spreadsheet quietly turned names into dates8 min
10Module 9: Classes and Objects7 parts · 101 min
- Module 9: Classes and Objects1 min
- Lesson 1: Classes, your own kinds of object17 min
- Lesson 2: Designing classes that work together19 min
- Lesson 3: Special methods: objects that print, compare and add16 min
- Lesson 4: Type hints and dataclasses, saying what each value is18 min
- Lab: Lend and return books with classes23 min
- Incident: A counter that ran out of room7 min
11Module 10: Intermediate Python7 parts · 97 min
- Module 10: Intermediate Python1 min
- Lesson 1: One loan at a time with iterators and generators15 min
- Lesson 2: Decorators: wrapping a function without changing it16 min
- Lesson 3: Context managers, clean-up that always happens15 min
- Lesson 4: Testing the shelf's rules with pytest16 min
- Lab: Test and protect the shelf's code27 min
- Incident: A reply that trusted the asked-for length7 min
12Module 11: Capstone3 parts · 42 min
- Module 11: Capstone1 min
- Lab: One command for the shelf each morning33 min
- Incident: Two digits for a year8 min
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.
Reviews
to review this course once you have finished it.