Lesson 071: for loops, range(), and iteration habits
Focus
Let the literals expose mistaken assumptions quickly: Basic drills for loops, range(), and iteration habits; spin token 635398 makes this page unlike its neighbours.
Key ideas
- Angle
Basic: micro cadence1mixesfor loops, range(), and iteration habits; spin64663. - Ritual: Freeze one literal constant with a purposeful name aloud.
- Guardrail: call out latent off-by-one before shipping analogues.
Example (LESSON_UID = "basic-071")
# Basic drill L071 topic-7 micro-0 pattern-2
LESSON_UID = "basic-071"
spin_a, spin_b, spin_c = 702, 131, 752
blob = "497|A"
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 31: Enumerate three pytest markers you'd decorate if this lived in CI. Literal nudge 31.
Fingerprints
- lesson_uid:
basic-071 - umbrella band:
for loops, range(), and iteration habits(1/10) - lesson_index:
2241