Python - Elif Statements
📖 Read the lesson
Code Life
By Pierre Marsaa
What is elif?
What if you need to check multiple conditions? That's where
elif
comes in! (
elif
: short for "else if")
The
elif
statement lets you check additional conditions if the previous conditions were False. It's a way to create multiple ways in your code.
Here's a simple example: checking which type your Codémon is.
↗️
Loading editor...
↶
▶️ Run
↷
Verify