Battery shelf
Use three batteries from the shelf, then print the remaining battery count.
'batteries'8'wheels'4'sensors'2Subtract used = 3 from the batteries value.
Allowed: inventory['batteries'], used, subtraction, and print(...).
Keys identify values by name, even if their display order changes. A missing key stops with a clear error. This is a small bounded Python subset.
Parts dictionary
Starting values (read-only lesson input)
inventory = {"batteries":8,"wheels":4,"sensors":2} Read a value by its key, not by where the key appears.
- Key:
"batteries" - 8
- Key:
"wheels" - 4
- Key:
"sensors" - 2
Border, ▶ marker and text identify the current read; color is an extra cue.
Help for this dictionary puzzleHints build in steps. Worked help and solutions need a deliberate choice.
Highest help used on this case: none