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

Python Basic — 035: Calibrate stdlib wedges with timing humility centred on `Strings from literals to slicing` [350024]

Lesson 035: Strings from literals to slicing

Focus

Assume a reviewer executes this verbatim: Basic drills Strings from literals to slicing; spin token 318471 makes this page unlike its neighbours.

Key ideas

Example (LESSON_UID = "basic-035")

# Basic drill L035 topic-3 micro-4 pattern-10
LESSON_UID = "basic-035"
spin_a, spin_b, spin_c = 837, 168, 944

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

cand = [12, 35, 345]
for candidate in cand:
    lbl, val = gate(candidate)
    print(candidate, lbl, val)

Practice

Practice 6: Verbal-diff this against lesson 34 aloud. Literal nudge 6.

Fingerprints