if, elif, and else

Scenario: A monitor must label response times healthy, slow, or critical.

New words, in plain English

An if tests first, elif adds ordered alternatives, and else catches everything remaining. Indentation defines each branch.

Analogy: A Python program is like a clear set of instructions for a careful helper: names label things, indentation groups steps, and errors explain where the helper became confused.

A small, real example

ms = 850
if ms >= 1000:
    label = "critical"
elif ms >= 500:
    label = "slow"
else:
    label = "healthy"
Tip: Put narrower or higher thresholds before broader ones.
Goal: Practice this idea in the py-conditionals-loops challenge at /labs/python. Fix the broken program, run it yourself, then use check to prove the real end state.