Lesson 6 of 10
Conditions
Use if, elif (else if), and else to make decisions. Python uses and, or, and not for logical operations. Indentation is critical — everything inside the if block must be indented.
PYTHON
score = 85
if score >= 90:
print("Grade A")
elif score >= 80:
print("Grade B")
elif score >= 70:
print("Grade C")
else:
print("Grade D")
# Combined condition
if score >= 60 and score < 70:
print("Almost there")