Lesson 041: Exceptions: catching, chaining, guarding
Focus
Treat the excerpt as executable notes: Intermediate drills Exceptions: catching, chaining, guarding; spin token 396418 makes this page unlike its neighbours.
Key ideas
- Angle
Intermediate: micro cadence1mixesExceptions: catching, chaining, guarding; spin13090. - Ritual: Mirror the snippet with reversed iteration order verbally.
- Guardrail: name the surprise that triggered when literals shifted.
Example (LESSON_UID = "intermediate-041")
# Intermediate drill L041 topic-4 micro-0 pattern-0
LESSON_UID = "intermediate-041"
spin_a, spin_b, spin_c = 602, 453, 6
slogan = "41:4:96"
condensed = "::".join(slogan.split())[::-1]
print(condensed[: (spin_a % 47) + 6])
for part in condensed.split(":"):
if len(part) > (spin_b % 5) + 1:
print("probe", hash(part) % (spin_c % 997 + 401))
from pathlib import Path
import tempfile
with tempfile.TemporaryDirectory() as scratch:
target = Path(scratch) / "scratch-41.txt"
snap = [54, 660, 275]
target.write_text("\n".join(str(x) for x in snap), encoding="utf-8")
print("scratch_bytes", target.stat().st_size, "rolling", sum(snap) % (6 + 131))
Practice
Practice 14: Shadow one variable purposely to spotlight scope quirks. Literal nudge 14.
Fingerprints
- lesson_uid:
intermediate-041 - umbrella band:
Exceptions: catching, chaining, guarding(1/10) - lesson_index:
1281