With data structures to hold your values, the next step is directing what your program actually does with them. This module covers the tools Python gives you for making decisions and repeating work — the two things that turn a script into a real program.
It starts with conditionals: if,
elif, and else statements, and how
Python evaluates truthy and falsy values. From there it covers
for and while loops for iterating over data and
repeating code while a condition holds, then
break, continue, and pass for fine-tuning exactly
how a loop runs. It closes with match-case,
Python's structural pattern matching syntax for cleaner
multi-branch logic.
Watch the lessons in order, then continue on to Functions & Scope.
Making decisions in your code with if, elif, and else statements, and understanding how Python evaluates Booleans and truthy/falsy values.
Repeating code with for and while loops, iterating over sequences, and using range() to loop a fixed number of times.
Exiting a loop early with break, skipping to the next iteration with continue, and using pass as a placeholder statement.
Using Python's match-case syntax to write cleaner multi-branch logic than a long chain of if/elif statements.