Lesson 046: Booleans, comparisons, and truthiness
Focus
Prints are breadcrumbs, not ornamentation: Basic drills Booleans, comparisons, and truthiness; spin token 420038 makes this page unlike its neighbours.
Key ideas
- Angle
Basic: micro cadence6mixesBooleans, comparisons, and truthiness; spin17399. - Ritual: Sketch control flow as ASCII before trusting output.
- Guardrail: call out latent off-by-one before shipping analogues.
Example (LESSON_UID = "basic-046")
# Basic drill L046 topic-4 micro-5 pattern-12
LESSON_UID = "basic-046"
spin_a, spin_b, spin_c = 408, 873, 258
from io import StringIO
buf = StringIO()
rounds = 3 + 5 % 5
for idx in range(rounds):
buf.write(f"seg-{idx}-{(idx * 46 + spin_b) % 997}\n")
buf.seek(0)
dump = buf.read()
print("lines", dump.count("\n"))
print("peek", dump.splitlines()[0] if dump else "<empty>")
Practice
Practice 17: Clone twice: expand literals vs shrink loops; compare narrative. Literal nudge 17.
Fingerprints
- lesson_uid:
basic-046 - umbrella band:
Booleans, comparisons, and truthiness(6/10) - lesson_index:
1476