Understand how Python makes decisions using if statements.
Use else and elif for multiple outcomes.
Combine conditions with comparison operators.
💻 Code Examples
age = 18
if age >= 18:
print("You are an adult.")
else:
print("You are a minor.")
# Using elif
score = 85
if score >= 90:
print("A grade")
elif score >= 80:
print("B grade")
else:
print("Needs improvement")
📝 Your Assignment
Write a program that asks for a user's age and prints one of the following:
“You are a child.” (if under 13)
“You are a teenager.” (13 to 19)
“You are an adult.” (20 and older)
# Your code here:
age = int(input("Enter your age: "))
# Write your if/elif/else here