Step: Conditionals: if / elif / else

Conditionals: if / elif / else

if / elif / else branches run top to bottom — the first true condition wins, and the rest are skipped.

Why it matters: order matters: a later elif never overrides an earlier match, so put the most specific condition first.

Example: with x = 5, if x > 10: ... elif x > 0: ... takes the elif branch.

Your turn: classify temperature = 15 as hot/mild/cold with the ranges above.

Pitfall: Python has no switch/case — a chain of elif (or a dict lookup for exact values) is the idiomatic replacement.

Setup:
temperature = 15
Your code:
Expected output:
mild
Step 9 of 18