UNIT 02 · TOPIC 11
Control Flow – if, if-else, if-elif-else
Conditional statements choose which block to execute based on a boolean condition.
The idea
Control Flow – if, if-else, if-elif-else, simply explained
Conditional statements choose which block to execute based on a boolean condition.
01
See the big picture
How the idea flows
Read the diagram as a simple path: begin with a problem, use the Python idea, then verify the result.
02
Everyday connection
Real-life example
↗
A grading system selects a result band based on the learner's score.
03
Learn by doing
Python code example
PYTHONExample
score = 78
if score >= 90:
grade = 'A'
elif score >= 60:
grade = 'B'
else:
grade = 'C'
print(grade)Expected result
BTry it: Change one value in the code, predict what will happen, then run it and compare your answer.
04
Keep this in mind
Key takeaways
- Conditional statements choose which block to execute based on a boolean condition.
- Think of a real problem where control flow – if, if-else, if-elif-else could save time or organize information.
- Test small changes and read the result carefully before moving to a bigger program.
Quick self-check
Can you explain it in your own words?
What is the main idea of Control Flow – if, if-else, if-elif-else?
Conditional statements choose which block to execute based on a boolean condition.
Where could you see this idea in everyday life?
A grading system selects a result band based on the learner's score.
