Caffeinated Coder
Book an appointment
Lesson 07 · First steps in code

Making decisions: if and else

A program that always does the same thing is not much use. Programs make decisions with if, elif and else. Run one nine-line Python program three times with different inputs and follow a token along a track: each comparison answers True or False, and exactly one path runs.

10 min10 steps5 questionsBeginner
Fig 7 · Interactive
Loading figure…
or ← →

Quiz Unlocks after the last step.