Skip to main content
Loading page…
Python Mastery
Chapter 5
Lesson 1 of 4
if / elif / else
Contents
Notes
Tutor
Concept
Decisions with if / elif / else
Loading activity…
Previous
1 / 8
Continue
Contents
Notes
Discussion
Tutor
25 min
8 activities
0 of 8 done
In this lesson
1
Decisions with if / elif / else
2
Truthiness — What Python Considers False
3
Nested vs Flat: Guard Clauses
4
The Ternary (Conditional) Expression
5
Quick Check: Short-Circuit Evaluation
6
Pitfall: = vs == Inside Conditions
7
Practice: BMI Category Classifier
8
Reflection: Truthy Empty Collections
Objectives
Learner can write multi-branch if/elif/else blocks that handle all meaningful cases
Learner can reason about Python's truthiness rules and apply them cleanly
Learner can refactor deeply nested conditionals into flat guard-clause style
Learner can write a ternary (conditional) expression for simple inline choices
Chapter 5 · Control Flow
if / elif / else
while Loops
for Loops & range
Structural Pattern Matching (match/case)
Previous: Choosing the Right Container
Next: while Loops