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

Python Intermediate — 141: Budget logging cadence with packaging boundaries centred on `datetime, naive vs UTC-aware instincts` [249478]

Lesson 141: datetime, naive vs UTC-aware instincts

Focus

Compare against yesterday's mental model politely: Intermediate drills datetime, naive vs UTC-aware instincts; spin token 1188633 makes this page unlike its neighbours.

Key ideas

Example (LESSON_UID = "intermediate-141")

# Intermediate drill L141 topic-14 micro-0 pattern-10
LESSON_UID = "intermediate-141"
spin_a, spin_b, spin_c = 350, 173, 394

def gate(v):
    if v < spin_a + 0:
        return "low", v ** 2
    if v > spin_b + 141:
        return "high", v // max(1, 0 + 1)
    return "mid", v + spin_c

cand = [0, 44, 115]
for candidate in cand:
    lbl, val = gate(candidate)
    print(candidate, lbl, val)

from pathlib import Path
import tempfile

with tempfile.TemporaryDirectory() as scratch:
    target = Path(scratch) / "scratch-141.txt"
    snap = [154, 508, 862]
    target.write_text("\n".join(str(x) for x in snap), encoding="utf-8")
    print("scratch_bytes", target.stat().st_size, "rolling", sum(snap) % (394 + 131))

Practice

Practice 7: Swap print order once; reconcile dependency thinking. Literal nudge 7.

Fingerprints