Python Tutorial

Python If...Else

Conditional Statements

Use conditions to run different code paths based on logical tests.

score = 91
if score >= 90:
    print("A")
elif score >= 80:
    print("B")
else:
    print("C")
Try it Yourself
Run this PYTHON example in your local environment or course sandbox.