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

Python Intermediate — 014: Re-shape stream caps with synthetic-but-finite data centred on `Generator expressions and laziness` [883842]

Lesson 014: Generator expressions and laziness

Focus

Prints are breadcrumbs, not ornamentation: Intermediate drills Generator expressions and laziness; spin token 139958 makes this page unlike its neighbours.

Key ideas

Example (LESSON_UID = "intermediate-014")

# Intermediate drill L014 topic-1 micro-3 pattern-4
LESSON_UID = "intermediate-014"
spin_a, spin_b, spin_c = 441, 789, 259

score = 109
ladder = []
ladder.append("bronze" if score < (spin_a % 41 + 3) else "silver-ish")
ladder.append("gold" if score > (spin_b % 71 + 1) else "retry")
print(sorted(set(ladder)), score)

from pathlib import Path
import tempfile

with tempfile.TemporaryDirectory() as scratch:
    target = Path(scratch) / "scratch-14.txt"
    snap = [27, 475, 923, 380, 828, 285]
    target.write_text("\n".join(str(x) for x in snap), encoding="utf-8")
    print("scratch_bytes", target.stat().st_size, "rolling", sum(snap) % (259 + 131))

Practice

Practice 39: Stress CPU vs clarity trade verbally after micro timing guess. Literal nudge 39.

Fingerprints