🗒 Cheat Sheet← Lesson
BitWithBite
Python Worksheet

🐍 Dictionaries

Chapter: Python · Level ★☆☆ · Time: 30 min
SCORE___ / 20
NameClassDate
After this worksheet you can
Create key-value pairsRead and update valuesUse get() safelyLoop over items

🧠 Section A · Concept Check ● BEGINNER 4 × 1 = 4

1d = {'a':1}; d['a'] is:
2Add a pair with:
3d.get('x') when 'x' missing returns:
4Keys must be:

🧮 Section B · Problem Solving ● INTERMEDIATE 2 + 3×3 = 11

5{'x':5}['x'] = .
6Safe lookup uses d.('key').
7Create a dict mapping 'name' to 'Ali'.
8Update person['name'] to 'Sara'.
9Loop printing key and value of d.

🚀 Section C · Challenge ● CHALLENGE 5

10Why does d['missing'] error but d.get('missing') not?
💭 Reflection — the most useful thing I learned:
A ___/4   B ___/11   C ___/5   Total ___/20 Teacher's Signature Parent's Signature
✂ answer key — fold or cut before handing out

1-B   2-B   3-C   4-A  |  5 5   6 get   7 = person = {'name': 'Ali'}   8 = person['name'] = 'Sara'   9 = for k, v in d.items(): print(k, v)  |  10 = [] raises KeyError; get() returns None (or a default)

📄 Need offline practice?Download the print-ready PDF or open the one-page cheat sheet.
⬇ Worksheet PDF 🗒 Cheat Sheet