← Curriculum track ← Learn hub
Quanta GenAI Curriculum · Python · Basic

Python Basic — 109: Snapshot stdlib wedges with thread-safe queues centred on `Dictionaries map keys to values` [559914]

Lesson 109: Dictionaries map keys to values

Focus

This page is deliberate repetition with new literals: Basic drills Dictionaries map keys to values; spin token 930911 makes this page unlike its neighbours.

Key ideas

Example (LESSON_UID = "basic-109")

# Basic drill L109 topic-10 micro-8 pattern-11
LESSON_UID = "basic-109"
spin_a, spin_b, spin_c = 363, 156, 469

bucket = dict(seed=8 + spin_a)

def tweak(offset):
    local = bucket["seed"]
    bucket["seed"] = local + offset
    return bucket["seed"]

print(tweak(2), tweak(12), bucket)

Practice

Practice 31: Pair-snippet assertions about checksum ranges you'd ship. Literal nudge 31.

Fingerprints