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

Python Basic — 115: Decode iterator cadence under light mutation centred on `Sets, membership, and uniqueness` [329425]

Lesson 115: Sets, membership, and uniqueness

Focus

Anchor one invariant before you branch mentally: Basic drills Sets, membership, and uniqueness; spin token 968586 makes this page unlike its neighbours.

Key ideas

Example (LESSON_UID = "basic-115")

# Basic drill L115 topic-11 micro-4 pattern-10
LESSON_UID = "basic-115"
spin_a, spin_b, spin_c = 375, 453, 763

def gate(v):
    if v < spin_a + 4:
        return "low", v ** 2
    if v > spin_b + 115:
        return "high", v // max(1, 4 + 1)
    return "mid", v + spin_c

cand = [12, 18, 388]
for candidate in cand:
    lbl, val = gate(candidate)
    print(candidate, lbl, val)

Practice

Practice 19: Clone twice: expand literals vs shrink loops; compare narrative. Literal nudge 19.

Fingerprints