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
- Angle
Basic: micro cadence5mixesStrings from literals to slicing; spin19644. - Ritual: Sketch control flow as ASCII before trusting output.
- Guardrail: call out latent off-by-one before shipping analogues.
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
- lesson_uid:
basic-035 - umbrella band:
Strings from literals to slicing(5/10) - lesson_index:
1117