if statements run code only if a condition is True.
age = 18
if age >= 18:
print("You can vote!")
else runs if condition is False:
if age >= 18:
print("Adult")
else:
print("Minor")
elif = else if — checks additional conditions.
Example:
temp = 25
if temp > 30:
print("Hot")
elif temp > 20:
print("Warm")
else:
print("Cool")
Nested:
if age >= 18:
if has_id:
print("Allowed")
else:
print("Need ID")