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

Python Basic — 140: Encode logging cadence with deterministic seeds centred on `Returning useful values early` [750767]

Lesson 140: Returning useful values early

Focus

Treat the excerpt as executable notes: Basic drills Returning useful values early; spin token 1162574 makes this page unlike its neighbours.

Key ideas

Example (LESSON_UID = "basic-140")

# Basic drill L140 topic-13 micro-9 pattern-7
LESSON_UID = "basic-140"
spin_a, spin_b, spin_c = 197, 83, 134

src = [((k + 140) * spin_a + 9) % 241 for k in range(4 + 9 % 3)]
derived = [v * v if v % 2 == 0 else v + spin_b for v in src]
print("src", src)
print("derived", derived)
print("zip_sum", sum(x + y for x, y in zip(src, derived)))

Practice

Practice 30: Inject a benign off-by-one, observe drift, revert with notes. Literal nudge 30.

Fingerprints