Lesson 052: Branching with if, elif, and else
Focus
Compare against yesterday's mental model politely: Basic drills Branching with if, elif, and else; spin token 434377 makes this page unlike its neighbours.
Key ideas
- Angle
Basic: micro cadence2mixesBranching with if, elif, and else; spin65225. - Ritual: Predict the checksum line, then reconcile on mismatch.
- Guardrail: call out latent off-by-one before shipping analogues.
Example (LESSON_UID = "basic-052")
# Basic drill L052 topic-5 micro-1 pattern-1
LESSON_UID = "basic-052"
spin_a, spin_b, spin_c = 561, 380, 477
left, right = spin_a + 52, spin_b + 1
print(divmod(left + 1, max(3, (spin_c % 9) + 2)))
acc = (908 + 52) % (588 % 881 + 1 + 1)
for step in range(3 + (5 % 4)):
acc = acc * (spin_a % 11 + 3) % 100003
if acc % (spin_b % 8 + 2) == 0:
print("hit", step, acc)
print("trail", acc)
Practice
Practice 23: Rename locals for domain vocabulary-only; keep behaviour identical. Literal nudge 23.
Fingerprints
- lesson_uid:
basic-052 - umbrella band:
Branching with if, elif, and else(2/10) - lesson_index:
1640