The Python beginner course
30 lessons across seven days, each with a Python editor you can run and change. Start at Day 1 or jump to whatever you need.
Seven days is a pace, not a deadline: each day is a module, and it's fine to take two sittings over one. Lessons marked Explore are optional on a first pass — nothing later in the course depends on them.
Make each day something you can use
Predict an example before running it, then change one input and explain the result. At the end of Days 1–6, close the examples and try the mixed-skills checkpoint. Its cases help you check a boundary as well as an ordinary answer.
Allow roughly 90–120 minutes of active study for a day, including practice, and split it into more sessions whenever needed. The estimates have not been measured with a learner pilot. Installing Python locally and Explore lessons can take extra time.
Begin the next session with a small task from memory. Day 7 adds a project, an independent brief, and delayed review. After the course, use the readiness check and intermediate preparation links to choose what comes next.
Print, variables, strings, and talking to the user.
Day overview- 1.1 Hello, Python Run your first Python program, print things to the screen, and leave notes for your future self.
- 1.2 Variables & Numbers Give values names, do arithmetic that behaves, and learn why 0.1 + 0.2 is not 0.3.
- 1.3 Strings & f-strings Build, slice and format text — the data type you will handle more than any other.
- 1.4 Input & Types Ask the user a question, convert what comes back, and understand why input() always hands you a string.
Decisions with if, repetition with while and for.
Day overview- 2.1 Booleans & Comparisons True, False, and the operators that produce them — the raw material of every decision your code makes.
- 2.2 if / elif / else Branching, indentation as syntax, and how to keep a chain of conditions readable.
- 2.3 while Loops Repeat while something stays true — counters, accumulators, validation loops, and how to avoid an infinite one.
- 2.4 for Loops & range() Walk through a sequence item by item — the loop you will write ten times more often than while.
- 3.1 Lists Ordered, changeable collections — how to build them, index them, slice them, sort them, and copy them safely.
- 3.2 Tuples & Unpacking Fixed collections, multiple return values, and the assignment trick that makes Python code look like Python.
- 3.3 Dictionaries Look values up by name instead of position — the collection behind configuration, JSON, counting and caching.
- 3.4 Sets & Choosing a Collection Unique items, fast membership tests, set arithmetic — and a decision table for picking the right container.
- 4.1 Defining Functions Wrap behaviour in a name, hand it inputs, get a value back — and learn why returning beats printing.
- 4.2 Arguments in Depth Explore Positional and keyword arguments, *args and **kwargs, and how mutable arguments can surprise you.
- 4.3 Scope & Lambdas Where names live, why functions cannot see each other's variables, and the one-line functions you pass to sort().
- 4.4 Comprehensions Transform and filter a collection in one readable line — the construct that makes Python look like Python.
Handling failure and reaching for the standard library.
Day overview- 5.1 Errors & Exceptions Read a traceback, catch what you can handle, raise what you cannot, and stop writing except: pass.
- 5.2 Reading & Writing Files Open files safely with with, read them line by line, write results back, and handle CSV without heroics.
- 5.3 Modules & the Standard Library Import code that already exists — math, random, datetime, collections, pathlib — and write your own module.
- 5.4 Python on Your Own Machine Leaving the browser: installing Python, running .py files, virtual environments, and pip.
Bundling data with the behaviour that belongs to it.
Day overview- 6.1 Classes & Objects Define your own types: __init__, attributes, methods, and the difference between a class and an instance.
- 6.2 Dunder Methods Explore Teach your objects to print, compare, add, and work with len() — by implementing the methods Python already looks for.
- 6.3 Inheritance & Composition Explore Share behaviour between classes — and learn why 'has a' usually beats 'is a'.
- 6.4 Dataclasses & Type Hints Let Python write the boilerplate, and annotate your code so tools and readers know what goes where.
Multi-file projects, tests, a capstone — and a program of your own.
Day overview- 7.1 Iterators & Generators Explore Produce values one at a time with yield — the idea behind for loops, file reading, and pipelines that never run out of memory.
- 7.2 Multi-File Projects Split a program across modules and packages, with imports that behave and a main entry point.
- 7.3 Testing Your Code assert, unittest and pytest — how to know your program still works after you change it.
- 7.4 Capstone: Build Something A complete program that uses everything from the week — and a map of where to go next.
- 7.5 On Your Own: A Fresh Brief Start a program from a blank file — a brief, requirements and sample output, with no finished version above it — then judge your own work against four questions.
- 7.6 Come Back Later: Review Challenges Short mixed challenges to do a week after the course and again a month after — because what you can still do then is what you've really learned.
Prefer to poke at it yourself?
The playground is a blank Python editor with nothing around it — useful for testing an idea from any lesson.
Open the playground