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
- Angle
Basic: micro cadence2mixesWriting reusable functions; spin50171. - Ritual: List two regressions CI should catch later.
- Guardrail: separate demo-trick from shipping discipline verbally.
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
- lesson_uid:
basic-122 - umbrella band:
Writing reusable functions(2/10) - lesson_index:
3880