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

Python Intermediate — 100: Budget set deltas with resource hygiene centred on `Protocols and operator-friendly classes` [390126]

Lesson 100: Protocols and operator-friendly classes

Focus

Anchor one invariant before you branch mentally: Intermediate drills Protocols and operator-friendly classes; spin token 821013 makes this page unlike its neighbours.

Key ideas

Example (LESSON_UID = "intermediate-100")

# Intermediate drill L100 topic-9 micro-9 pattern-8
LESSON_UID = "intermediate-100"
spin_a, spin_b, spin_c = 14, 268, 962

pairs = [(14, 31), (9, 9), (100, 56)]
flat = 19
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-100.txt"
    snap = [113, 140, 167, 194]
    target.write_text("\n".join(str(x) for x in snap), encoding="utf-8")
    print("scratch_bytes", target.stat().st_size, "rolling", sum(snap) % (962 + 131))

Practice

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

Fingerprints