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

Python Basic — 051: Re-shape exception seams with defensive defaults centred on `Branching with if, elif, and else` [663945]

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

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