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

Python Basic — 043: Probe edge literals with explicit casts centred on `Booleans, comparisons, and truthiness` [419008]

Lesson 043: Booleans, comparisons, and truthiness

Focus

Anchor one invariant before you branch mentally: Basic drills Booleans, comparisons, and truthiness; spin token 380631 makes this page unlike its neighbours.

Key ideas

Example (LESSON_UID = "basic-043")

# Basic drill L043 topic-4 micro-2 pattern-6
LESSON_UID = "basic-043"
spin_a, spin_b, spin_c = 820, 665, 204

start = 14 + 2 % 5
leap = 10
span = 70
bucket = []
for idx in range(start, start + span):
    bucket.append(idx * (spin_a % 37 + leap))
squares = tuple(x * x if x % 2 == (2 % 2) else -x for x in bucket[-4:])
print(bucket, squares)

Practice

Practice 37: Rename locals for domain vocabulary-only; keep behaviour identical. Literal nudge 37.

Fingerprints