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

Python Basic — 122: Nudge branch choreography with fixture parametrization instincts centred on `Writing reusable functions` [579306]

Lesson 122: Writing reusable functions

Focus

Assume a reviewer executes this verbatim: Basic drills Writing reusable functions; spin token 1009892 makes this page unlike its neighbours.

Key ideas

Example (LESSON_UID = "basic-122")

# Basic drill L122 topic-12 micro-1 pattern-10
LESSON_UID = "basic-122"
spin_a, spin_b, spin_c = 641, 77, 684

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

cand = [3, 25, 199]
for candidate in cand:
    lbl, val = gate(candidate)
    print(candidate, lbl, val)

Practice

Practice 7: Freeze async sleep at zero vs tiny float; articulate scheduling impact. Literal nudge 7.

Fingerprints