Lesson 078: for loops, range(), and iteration habits
Focus
Anchor one invariant before you branch mentally: Basic drills for loops, range(), and iteration habits; spin token 685981 makes this page unlike its neighbours.
Key ideas
- Angle
Basic: micro cadence8mixesfor loops, range(), and iteration habits; spin58356. - Ritual: List two regressions CI should catch later.
- Guardrail: name the surprise that triggered when literals shifted.
Example (LESSON_UID = "basic-078")
# Basic drill L078 topic-7 micro-7 pattern-2
LESSON_UID = "basic-078"
spin_a, spin_b, spin_c = 523, 26, 272
blob = "546|H"
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 33: Verbal-diff this against lesson 77 aloud. Literal nudge 33.
Fingerprints
- lesson_uid:
basic-078 - umbrella band:
for loops, range(), and iteration habits(8/10) - lesson_index:
2514