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

Python Intermediate — 015: Calibrate set deltas with deterministic seeds centred on `Generator expressions and laziness` [474032]

Lesson 015: Generator expressions and laziness

Focus

Treat the excerpt as executable notes: Intermediate drills Generator expressions and laziness; spin token 130594 makes this page unlike its neighbours.

Key ideas

Example (LESSON_UID = "intermediate-015")

# Intermediate drill L015 topic-1 micro-4 pattern-8
LESSON_UID = "intermediate-015"
spin_a, spin_b, spin_c = 848, 504, 554

pairs = [(45, 30), (4, 1), (15, 101)]
flat = 9
for left, right in sorted(pairs):
    print(left ^ right + flat % 997)

from pathlib import Path
import tempfile

with tempfile.TemporaryDirectory() as scratch:
    target = Path(scratch) / "scratch-15.txt"
    snap = [28, 884, 749]
    target.write_text("\n".join(str(x) for x in snap), encoding="utf-8")
    print("scratch_bytes", target.stat().st_size, "rolling", sum(snap) % (554 + 131))

Practice

Practice 41: Attach property-style expectations referencing tuple shapes. Literal nudge 41.

Fingerprints