Learn Python from your first print() to a small project, with every exercise checked as you go.
15 lessons, 29 exercises. Runs Python 3.14.
Not started
Hello, output
Print text to the screen, add comments, and see how Python runs a program from top to bottom.
Values and variables
Store values in named variables, meet Python's basic types, and build text with f-strings.
Reading input and arithmetic
Read text from standard input, turn it into numbers, and calculate with Python's arithmetic operators.
Making decisions
Use if, elif and else with comparison and boolean operators so your program can choose what to do.
Loops
Repeat work with for and while loops, count with range(), and stop early with break and continue.
Functions
Package code into reusable functions with parameters, default values and return values, and learn how scope works.
Collections
Store many values in lists, tuples and dictionaries, and loop over them.
Strings and a small project
Slice, search, clean and format text, then combine everything so far into a small receipt printer.
Handling errors
Catch exceptions with try and except, clean up with finally, and raise your own errors when something is wrong.
Structuring data with classes
Bundle data and behaviour together with classes, and let dataclasses write the boring parts for you.
Recursion
Solve problems by having a function call itself on a smaller piece, and speed it up with caching.
Sorting and searching
Sort with custom keys and multiple criteria, and find things fast in sorted data with the bisect module.
Dictionaries and sets in depth
Count, group and compare data with dict methods, Counter, defaultdict and set operations.
Comprehensions and generators
Build lists, sets and dicts in one readable line, and produce values lazily with generators.
Final project: a gradebook
Combine classes, exceptions, dictionaries, sorting and formatting into one complete gradebook program.
Your progress is saved in this browser. Sign in to keep it on every device.