Learn how Python makes decisions and repeats work using if/elif/else, truthiness, while and for loops, range(), and loop control with break, continue and pass. This beginner course builds the control-flow fluency the Python Institute PCEP exam expects, through runnable examples and a hands-on lab.
Watch the free preview
The if statement and boolean conditions — free to watch, no account needed.
What you'll learn
- Write conditional logic using if, elif and else with correct indentation
- Apply Python truthiness rules to evaluate any value as a condition
- Repeat work with while and for loops driven by range() and sequences
- Control loop flow using break, continue, pass and the loop else clause
- Combine nested loops and conditionals to solve real programming problems
Syllabus
Making Decisions with if/elif/else
The if statement and boolean conditionsFree preview
elif, else and truthiness
Repeating Work with Loops
The while loop
The for loop and range()
Controlling Loop Flow
break, continue and pass
The else clause on loops
Combining Control Flow
Nested loops
Putting it together — guards and menu loops
Lab — 10 Programming Exercises & Solutions
Programming Exercises 1–5
Programming Exercises 6–10