More Options with elif
Choose between several paths.
More Than Two Choices 🎚️
Hi, choice champion! 🏆 Sometimes there are MORE than two options. Like a traffic light: red, yellow, green! 🚦 For this we use elif!
The elif Word 🪜
elif means "else if". It checks another thing if the first if was False.
light = "yellow"
if light == "red":
print("Stop! 🛑")
elif light == "yellow":
print("Slow down! 🟡")All lessons in this course
- Choosing with if
- The else Backup Plan
- Comparing Values
- More Options with elif