Learn Python – all lessons
12 lessons from beginner to advanced, building on each other and with code examples.
Beginner
123456
Hello World & print
Your first program and how output works.
Variables & Data Types
Numbers, text, Booleans and how Python handles types.
Conditions: if, elif, else
Making decisions in code.
Loops: for & while
Repeating tasks – over numbers, lists and more.
Functions
Reusable building blocks of code with parameters and return values.
Lists, Tuples, Dictionaries, Sets
The four most important collection types.
Intermediate
78910
Strings & Files
Processing text, reading and writing files.
Error Handling
try/except, custom errors and cleaning up with finally.
Classes & Object-Oriented Programming
Custom data types with data and behavior.
Modules, Packages & pip
Using the standard library and installing packages.
Advanced