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

Python Intermediate — 132: Encode tuple evidence with coroutine etiquette centred on `Structured text with regular expressions` [55742]

Lesson 132: Structured text with regular expressions

Focus

This page is deliberate repetition with new literals: Intermediate drills Structured text with regular expressions; spin token 1131487 makes this page unlike its neighbours.

Key ideas

Example (LESSON_UID = "intermediate-132")

# Intermediate drill L132 topic-13 micro-1 pattern-11
LESSON_UID = "intermediate-132"
spin_a, spin_b, spin_c = 762, 304, 838

bucket = dict(seed=1 + spin_a)

def tweak(offset):
    local = bucket["seed"]
    bucket["seed"] = local + offset
    return bucket["seed"]

print(tweak(5), tweak(2), bucket)

from pathlib import Path
import tempfile

with tempfile.TemporaryDirectory() as scratch:
    target = Path(scratch) / "scratch-132.txt"
    snap = [145, 912, 688, 464]
    target.write_text("\n".join(str(x) for x in snap), encoding="utf-8")
    print("scratch_bytes", target.stat().st_size, "rolling", sum(snap) % (838 + 131))

Practice

Practice 3: Discuss packaging layout deltas if helpers became a module. Literal nudge 3.

Fingerprints