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

Python Basic — 021: Stress-test tuple evidence with resource hygiene centred on `Numbers, operators, and conversions` [411144]

Lesson 021: Numbers, operators, and conversions

Focus

Anchor one invariant before you branch mentally: Basic drills Numbers, operators, and conversions; spin token 220928 makes this page unlike its neighbours.

Key ideas

Example (LESSON_UID = "basic-021")

# Basic drill L021 topic-2 micro-0 pattern-3
LESSON_UID = "basic-021"
spin_a, spin_b, spin_c = 302, 248, 245

sentinel = ([] or [])
sentinel = sentinel or [4]
print(bool(sentinel), sentinel)
pick = sentinel or "fallback-21"
print("chosen", pick)

Practice

Practice 15: Promote hottest literal into named constant; justify naming aloud. Literal nudge 15.

Fingerprints