Real programs react: an if checks a condition and runs one branch while skipping the rest.
1 if = Gatekeeper
The indented body under if runs only when the condition is True.
2 elif = Next Check
Tried only when every earlier check failed — the chain stops at the first match.
3 else = Safety Net
Runs when nothing above matched; it has no condition of its own.
4 Indentation Rules
Everything indented under the if belongs to it; Python uses 4 spaces by convention.
Teaching code to choose
if = Gatekeeper1The indented body under if runs only when the condition is True.
elif = Next Check2Tried only when every earlier check failed — the chain stops at the first match. else = Safety Net3Runs when nothing above matched; it has no condition of its own.
Indentation Rules4Everything indented under the if belongs to it; Python uses 4 spaces by convention. 4 building blocks make up Teaching code to choose
Follow the token: each diamond is a check, and exactly one branch wins.
process decision input / output start / end Conditions are tested top to bottom — the first True wins and the rest of the chain is skipped.
Console
output appears as the program runs…
Click a keyword, then click its job in the chain.
4 conceptsTap a card to expand ?ifdrops into place
?elifdrops into place
?elsedrops into place
?anddrops into place
Only the first matching branch runs. What does this thermometer print?
Your predicted output — one line per console line
Hint: Only the FIRST matching branch runs — every later branch is skipped. "done" prints no matter which branch was chosen.
01An if/elif/else chain runs exactly one branch — the first whose condition is True.
02elif and else are optional; a plain if also works alone.
03The colon and the 4-space indent define what belongs to the branch.
04Code after the chain always runs, whichever branch was taken.
05Conditions end in a bool: comparisons like score >= 60 feed the if.