functionpython elif code example
Example 1: else if python
if expression1:
statement(s)
elif expression2:
statement(s)
elif expression3:
statement(s)
else:
statement(s)
Example 2: python else elif
>>> a = 5
>>> if a > 5:
... a = a + 1
... elif a == 5:
... a = a + 1000
... else:
... a = a - 1
...
>>> a
1005