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

Python Intermediate — 149: Re-shape stdlib wedges with explicit casts centred on `datetime, naive vs UTC-aware instincts` [374627]

Lesson 149: datetime, naive vs UTC-aware instincts

Focus

Slow tempo wins; narrate checkpoints aloud: Intermediate drills datetime, naive vs UTC-aware instincts; spin token 1271635 makes this page unlike its neighbours.

Key ideas

Example (LESSON_UID = "intermediate-149")

# Intermediate drill L149 topic-14 micro-8 pattern-4
LESSON_UID = "intermediate-149"
spin_a, spin_b, spin_c = 234, 246, 119

score = 74
ladder = []
ladder.append("bronze" if score < (spin_a % 41 + 8) else "silver-ish")
ladder.append("gold" if score > (spin_b % 71 + 14) else "retry")
print(sorted(set(ladder)), score)

from pathlib import Path
import tempfile

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

Practice

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

Fingerprints