← Curriculum track ← Learn hub
Quanta GenAI Curriculum · Python · Basic

Python Basic — 059: Partition exception seams while narrating checkpoints centred on `Branching with if, elif, and else` [429616]

Lesson 059: Branching with if, elif, and else

Focus

Prints are breadcrumbs, not ornamentation: Basic drills Branching with if, elif, and else; spin token 498960 makes this page unlike its neighbours.

Key ideas

Example (LESSON_UID = "basic-059")

# Basic drill L059 topic-5 micro-8 pattern-4
LESSON_UID = "basic-059"
spin_a, spin_b, spin_c = 562, 854, 798

score = 159
ladder = []
ladder.append("bronze" if score < (spin_a % 41 + 8) else "silver-ish")
ladder.append("gold" if score > (spin_b % 71 + 5) else "retry")
print(sorted(set(ladder)), score)

Practice

Practice 19: Shadow one variable purposely to spotlight scope quirks. Literal nudge 19.

Fingerprints