Dictionaries · Complete the Code
Shape — improve or specify
L3 Application
Blocks
~2 min
Print every key with its value
The program should print each item with its price, as 'tea 2' and then 'cake 4'. Which expression completes the blank?
prices = {"tea": 2, "cake": 4}
for item in prices:
print(item, ______)
Why this activity was chosen
- Bloom level: L3 Application: Choose the fragment that completes a partly written program.
- 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.
Application without a blank page: students apply a concept by deciding what the missing piece must be, which requires reading the surrounding code and the stated requirement. Distractors encode off-by-one, quoting and operator errors that generated code often contains.
AI’s role here: AI may hint at what the blank has to do. It must not name the fragment.