First Steps
Run your first program, show output, return a computed value, store values in variables, and set up an environment you can install real packages into.
Your first program: print & comments
Show output with print(), leave comments, and return a value to be checked.
Functions & return values
Write functions that take an input, compute, and return a value.
Variables & assignment
Bind names to values with =, reassign them, and use them in expressions.
Running Python & installing packages
Run a .py file, isolate dependencies in a virtual environment, and pin them with pip.
Data Types
Numbers, booleans, None, and converting between types.
Ints, floats & arithmetic
Do math with integers and floats, including floor division and modulo.
Booleans, None & type conversion
Use True/False and None, convert between types, and reason about truthiness.
is vs == and checking for None
Tell identity (is) apart from equality (==), and check for None the right way.
Strings & Formatting
Index, slice, and reshape text with string methods and f-strings.
Collections
Lists, tuples, sets, and dictionaries (Python's core containers).
Control Flow & Functions
Branch with if/else, repeat with loops, and package logic into functions.
if / elif / else & logical operators
Branch on conditions and combine them with and / or / not.
Small syntax that shows up everywhere: ternary, swap & match
Write a conditional expression, swap and unpack tuples, and branch with match/case.
for, while, range & break/continue
Repeat work over collections and ranges, accumulating a result.
Looping like a Pythonista: enumerate, zip & items
Loop with a counter (enumerate), over two lists at once (zip), and over a dict (.items()).
Functions, parameters & defaults
Write functions with default parameters and learn to read a traceback.
Debugging: reading a traceback & stepping with breakpoint()
Read a traceback bottom-up, pause code with breakpoint(), and pick print vs stepping.
References, copies & the mutable-default trap
Names share objects: build new lists instead of mutating, and never use a mutable default argument.
Choosing the right data structure
Pick a set or dict for fast membership and lookups instead of scanning a list.
Recursion: a function that calls itself
Solve a problem in terms of a smaller version of itself, with a base case to stop.