The elif statement is used when we want to check multiple conditions one after another.
An elif block executes only when the previous conditions are false or its own condition is true
Syntax :
Python
if condition1: statement(s) elif condition2: statement(s) elif condition3: statement(s) else: statement(s) Example :
Python
age = 16 if age >= 60: print("Senior Citizen") elif age >= 18: print("Adult") elif age >= 13: print("Teenager") else: print("Child") #output Teenager