The else statement is executed when the if condition (and any elif conditions) evaluate to False.
Syntax :
Python
if condition: statement(s) else: statement(s) Example :
Python
num = 7 if num % 2 == 0: print("Even Number") else: print("Odd Number") #output Odd Number Python
age = 12 if age >= 18: print("Adult") elif age >= 13: print("Teenager") else: print("Child") #output Child