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

Python Intermediate — 142: Partition stream caps with fresh literals centred on `datetime, naive vs UTC-aware instincts` [209820]

Lesson 142: datetime, naive vs UTC-aware instincts

Focus

Treat the excerpt as executable notes: Intermediate drills datetime, naive vs UTC-aware instincts; spin token 1164669 makes this page unlike its neighbours.

Key ideas

Example (LESSON_UID = "intermediate-142")

# Intermediate drill L142 topic-14 micro-1 pattern-4
LESSON_UID = "intermediate-142"
spin_a, spin_b, spin_c = 128, 674, 84

score = 69
ladder = []
ladder.append("bronze" if score < (spin_a % 41 + 1) 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-142.txt"
    snap = [155, 288, 421, 554]
    target.write_text("\n".join(str(x) for x in snap), encoding="utf-8")
    print("scratch_bytes", target.stat().st_size, "rolling", sum(snap) % (84 + 131))

Practice

Practice 6: Promote hottest literal into named constant; justify naming aloud. Literal nudge 6.

Fingerprints