🔀 Lesson 2: Control Flow (if/else)

🎯 Learning Objectives

💻 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:

# Your code here:
age = int(input("Enter your age: "))

# Write your if/elif/else here
← Back to Dashboard