Tutorial
Elif Statements in Python
In Python, elif (short for "else if") allows you to check multiple conditions in sequence. Use elif after anif statement to test additional conditions.
Syntax
Example
Explanation
- The first
ifchecks ifscore >= 90. - If that is False, Python checks the first
elif. - If none of the
iforelifconditions are True, theelseblock runs. - Conditions are checked in order, top to bottom.