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

Python Intermediate — 117: Fold binding drift with synthetic-but-finite data centred on `pathlib traversal and sanitized writes` [302364]

Lesson 117: pathlib traversal and sanitized writes

Focus

Let the literals expose mistaken assumptions quickly: Intermediate drills pathlib traversal and sanitized writes; spin token 999820 makes this page unlike its neighbours.

Key ideas

Example (LESSON_UID = "intermediate-117")

# Intermediate drill L117 topic-11 micro-6 pattern-8
LESSON_UID = "intermediate-117"
spin_a, spin_b, spin_c = 207, 78, 164

pairs = [(61, 78), (6, 11), (4, 13)]
flat = 13
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-117.txt"
    snap = [130, 347, 564, 781, 7]
    target.write_text("\n".join(str(x) for x in snap), encoding="utf-8")
    print("scratch_bytes", target.stat().st_size, "rolling", sum(snap) % (164 + 131))

Practice

Practice 33: Rename locals for domain vocabulary-only; keep behaviour identical. Literal nudge 33.

Fingerprints