Learn Python
Every Python track, one tiny lesson at a time
54 hand-written lessons across 10 tracks — from your first print() to classes and regular expressions.
1. Python Basics
Your first real Python · 9 lessons
Start from zero: print output, store values in variables, do math, join strings, and format text with f-strings. The foundation everything else builds on.
2. Strings
Text, sliced and diced · 4 lessons
Reach into text by index, clean it up, transform it with built-in methods, and split or join it back together — the everyday work of handling words.
3. Control Flow & Loops
Decisions and repetition · 8 lessons
Teach your code to choose with if / elif / else and boolean logic, then repeat work with for and while loops, range(), break, continue and nesting.
4. Lists, Dicts & Data
Collections that hold your data · 11 lessons
The workhorses of Python: lists, slicing and negative indexes, dictionaries, tuples and sets, sorting, membership tests and nested data.
5. Functions
Reusable building blocks · 7 lessons
Package logic into functions: parameters and defaults, keyword arguments, scope, *args and **kwargs, lambdas, and the map / filter pair.
6. Comprehensions
Pythonic one-liners · 3 lessons
Write compact, readable transforms with list, filtering and dict comprehensions — the idiom that makes code look and feel like real Python.
7. Errors & Exceptions
When things go wrong · 3 lessons
Handle failure gracefully with try / except, recognise common exception types, and use finally and raise to keep programs robust.
8. Files & Modules
Beyond a single script · 3 lessons
Read and write files safely with the with statement, and pull in extra power by importing modules from the standard library and beyond.
9. Classes & OOP
Object-oriented Python · 4 lessons
Model the world with objects: define classes and __init__, add methods, control how they print with __str__, and reuse behaviour via inheritance.
10. Regular Expressions
Pattern matching · 2 lessons
Search and extract patterns in text with the re module: re.search, findall, and the quantifiers that make regular expressions powerful.