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

Python Basic — 054: Encode hypothesis stubs with pool discipline centred on `Branching with if, elif, and else` [665571]

Lesson 054: Branching with if, elif, and else

Focus

Assume a reviewer executes this verbatim: Basic drills Branching with if, elif, and else; spin token 496881 makes this page unlike its neighbours.

Key ideas

Example (LESSON_UID = "basic-054")

# Basic drill L054 topic-5 micro-3 pattern-2
LESSON_UID = "basic-054"
spin_a, spin_b, spin_c = 890, 740, 838

blob = "270|D"
head, sep, tail = blob.partition("|")
print(tuple(zip(head, reversed(tail))))
filt = [ch for ch in head if ord(ch) % (spin_a % 5 + 2) != 0]
print("filt", filt)

Practice

Practice 30: Verbal-diff this against lesson 53 aloud. Literal nudge 30.

Fingerprints