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

Python Intermediate — 047: Stress-test stdlib wedges with scaffolding comments centred on `Exceptions: catching, chaining, guarding` [86483]

Lesson 047: Exceptions: catching, chaining, guarding

Focus

Slow tempo wins; narrate checkpoints aloud: Intermediate drills Exceptions: catching, chaining, guarding; spin token 439198 makes this page unlike its neighbours.

Key ideas

Example (LESSON_UID = "intermediate-047")

# Intermediate drill L047 topic-4 micro-6 pattern-4
LESSON_UID = "intermediate-047"
spin_a, spin_b, spin_c = 624, 177, 625

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

from pathlib import Path
import tempfile

with tempfile.TemporaryDirectory() as scratch:
    target = Path(scratch) / "scratch-47.txt"
    snap = [60, 694, 337, 971, 614]
    target.write_text("\n".join(str(x) for x in snap), encoding="utf-8")
    print("scratch_bytes", target.stat().st_size, "rolling", sum(snap) % (625 + 131))

Practice

Practice 24: Pair-snippet assertions about checksum ranges you'd ship. Literal nudge 24.

Fingerprints