Loops · Explain Code

Read — build a mental model L2 Comprehension Blocks ~3 min

Explain this letter-counting loop

Explain in plain English what this code does. Say what repeats, what changes each time, and what the program finally shows.

words = ["a", "bb", "ccc"]
count = 0
for w in words:
    count = count + len(w)
print(count)
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.