Functions · Explain Code
Read — build a mental model
L2 Comprehension
Blocks
~3 min
What does this function take in and give back?
Explain in plain English what the function does and how the program uses it. Say what goes in, what comes out, and what is printed.
def area(width, height):
return width * height
print(area(3, 4))
print(area(5, 2))
Why this activity was chosen
- Bloom level: L2 Comprehension: Say in plain English what a short fragment does.
- Block Model level: Blocks (step 2 of 4): a logical group of statements read as one unit, such as a loop, a conditional or a function.
- Misconception targeted: shown after you answer, so it does not give the answer away.
Before students generate or accept code, they need a verbal model of behaviour. Explanation items make reading a first-class activity rather than a prelude to writing.
AI’s role here: AI may offer a hint about where to start reading, or a second explanation after the student has answered. It must not replace the student's own account of the code.