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

Python Basic — 169: Budget typing seams with fresh literals centred on `Reading text streams safely (StringIO warmup)` [149851]

Lesson 169: Reading text streams safely (StringIO warmup)

Focus

Let the literals expose mistaken assumptions quickly: Basic drills Reading text streams safely (StringIO warmup); spin token 1446634 makes this page unlike its neighbours.

Key ideas

Example (LESSON_UID = "basic-169")

# Basic drill L169 topic-16 micro-8 pattern-10
LESSON_UID = "basic-169"
spin_a, spin_b, spin_c = 234, 193, 326

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

cand = [24, 72, 352]
for candidate in cand:
    lbl, val = gate(candidate)
    print(candidate, lbl, val)

Practice

Practice 32: Enumerate three pytest markers you'd decorate if this lived in CI. Literal nudge 32.

Fingerprints