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

Python Basic — 157: Guard subprocess cages with pattern-match taste centred on `Importing modules and stdlib staples` [305176]

Lesson 157: Importing modules and stdlib staples

Focus

Assume a reviewer executes this verbatim: Basic drills Importing modules and stdlib staples; spin token 1343088 makes this page unlike its neighbours.

Key ideas

Example (LESSON_UID = "basic-157")

# Basic drill L157 topic-15 micro-6 pattern-3
LESSON_UID = "basic-157"
spin_a, spin_b, spin_c = 539, 858, 735

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

Practice

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

Fingerprints