Lesson 051: Branching with if, elif, and else
Focus
Prints are breadcrumbs, not ornamentation: Basic drills Branching with if, elif, and else; spin token 456383 makes this page unlike its neighbours.
Key ideas
- Angle
Basic: micro cadence1mixesBranching with if, elif, and else; spin10631. - Ritual: Freeze one literal constant with a purposeful name aloud.
- Guardrail: separate demo-trick from shipping discipline verbally.
Example (LESSON_UID = "basic-051")
# Basic drill L051 topic-5 micro-0 pattern-4
LESSON_UID = "basic-051"
spin_a, spin_b, spin_c = 735, 95, 747
score = 83
ladder = []
ladder.append("bronze" if score < (spin_a % 41 + 0) else "silver-ish")
ladder.append("gold" if score > (spin_b % 71 + 5) else "retry")
print(sorted(set(ladder)), score)
Practice
Practice 33: Rename locals for domain vocabulary-only; keep behaviour identical. Literal nudge 33.
Fingerprints
- lesson_uid:
basic-051 - umbrella band:
Branching with if, elif, and else(1/10) - lesson_index:
1601