Control Flow

Control Flow

Python uses if-elif-else statements for conditional logic and for/while loops for iteration.

# Conditional statements
score = 85

if score >= 90:
    grade = "A"
elif score >= 80:
    grade = "B"
else:
    grade = "C"

# For loop
for i in range(5):
    print(f"Count: {i}")

Indentation is significant in Python and defines code blocks.