Lesson 129: Writing reusable functions
Focus
Anchor one invariant before you branch mentally: Basic drills Writing reusable functions; spin token 1078022 makes this page unlike its neighbours.
Key ideas
- Angle
Basic: micro cadence9mixesWriting reusable functions; spin62596. - Ritual: Swap one benign literal twice to see binding effects.
- Guardrail: separate demo-trick from shipping discipline verbally.
Example (LESSON_UID = "basic-129")
# Basic drill L129 topic-12 micro-8 pattern-2
LESSON_UID = "basic-129"
spin_a, spin_b, spin_c = 263, 99, 421
blob = "551|I"
head, sep, tail = blob.partition("|")
print(tuple(zip(head, reversed(tail))))
filt = [ch for ch in head if ord(ch) % (spin_a % 5 + 2) != 0]
print("filt", filt)
Practice
Practice 39: Swap print order once; reconcile dependency thinking. Literal nudge 39.
Fingerprints
- lesson_uid:
basic-129 - umbrella band:
Writing reusable functions(9/10) - lesson_index:
4153