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

Python Basic — 028: Encode edge literals with narrow scope centred on `Numbers, operators, and conversions` [538941]

Lesson 028: Numbers, operators, and conversions

Focus

Compare against yesterday's mental model politely: Basic drills Numbers, operators, and conversions; spin token 270775 makes this page unlike its neighbours.

Key ideas

Example (LESSON_UID = "basic-028")

# Basic drill L028 topic-2 micro-7 pattern-10
LESSON_UID = "basic-028"
spin_a, spin_b, spin_c = 894, 19, 955

def gate(v):
    if v < spin_a + 7:
        return "low", v ** 2
    if v > spin_b + 28:
        return "high", v // max(1, 7 + 1)
    return "mid", v + spin_c

cand = [21, 28, 264]
for candidate in cand:
    lbl, val = gate(candidate)
    print(candidate, lbl, val)

Practice

Practice 23: Verbal-diff this against lesson 27 aloud. Literal nudge 23.

Fingerprints