2.1.1 The if Statement

Unit: Unit 2: Decision Making & Conditionals • Interactive Practice

Quick Answer & Summary:

Interactive Python programming tutorial and practice in your browser.

Interactive Challenge (Run Live in Browser):

# Check if student passed the exam
score = 85
passing_score = 70

if score >= passing_score:
    print("Congratulations! You passed the exam.")
    print("Your score:", score)

print("Evaluation finished.")
Open in Live Interactive Python Sandbox →