Lists · Extend the Code

Shape — improve or specify L5 Synthesis Macro Structure ~5 min

Collect the passing marks

This program counts passing marks (50 or more). Extend it so it also builds a new list called passed that contains the passing marks, and prints that list. You may write code or describe your changes in words.

marks = [45, 82, 67, 30, 91]
count = 0
for m in marks:
    if m >= 50:
        count = count + 1
print(count)
Why this activity was chosen
  • Bloom level: L5 Synthesis: Add functionality to working code, combining ideas.
  • Block Model level: Macro Structure (step 4 of 4): the purpose of the whole program: the problem it solves and the goal it serves.
  • Misconception targeted: shown after you answer, so it does not give the answer away.

Synthesis: combining concepts already met (variables, loops, conditions, lists, functions) to build something new on a working base, and reasoning about where the new code belongs.

AI’s role here: AI may ask what information the new feature needs. It must not write the extension.