Skip to content

The basics · Decisions

Making decisions

An `if` chooses; an `elif` chain chooses exactly one. · 8 minutes

Predict first

What does this print?

1temperature = 30
2if temperature > 10:
3 print("mild")
4elif temperature > 25:
5 print("hot")
6else:
7 print("cold")