Python If...Else

Conditional Statements

Use if, elif, and else to control flow.

Nested Conditions

Combine multiple conditions using logical operators (and, or).

Examples

age = 18
if age >= 18:
    print("Adult")
elif age >= 13:
    print("Teenager")
else:
    print("Child")