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
- Angle
Basic: micro cadence5mixesSets, membership, and uniqueness; spin51906. - Ritual: List two regressions CI should catch later.
- Guardrail: name the surprise that triggered when literals shifted.
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
- lesson_uid:
basic-115 - umbrella band:
Sets, membership, and uniqueness(5/10) - lesson_index:
3677