Twenty lessons. Today you stitch four of them together on a tiny generic input. No new APIs.
Given an in-memory list of three IDs ["a", "b", "c"] and a values dict {"a": 5, "b": 15, "c": 20}:
"alert: <id>=<value>".Expected output: alerts fire for b (15) and c (20). a (5) is below threshold, skipped.
values_by_id = {"a": 5, "b": 15, "c": 20}
threshold = 10
ids = ["a", "b", "c"]
print("step 1: walking ids")
sent = 0
for item_id in ids:
value = values_by_id.get(item_id, 0)
if value > threshold:
print(f"step 2: {item_id}={value} above threshold, alerting")
toolset.execute_action(Action.GOOGLECALENDAR_CREATE_EVENT, {
"calendar_id": "primary",
"summary": f"alert: {item_id}={value}",
"start_datetime": "2026-12-31T11:00:00+00:00",
"event_duration_minutes": 15,
})
sent += 1
print(f"step 3: sent {sent} alerts")No new concepts at all?
Zero. Look-up (week 1 dicts), if-on-condition (week 2), side-effect call (week 9), step logging (yesterday). The whole-week skill: assemble these without overthinking.
| Primitive | From | Used for |
|---|---|---|
Dict lookup with .get(key, default) | Auto-Beg L3 (and Py-Beg L15) | reading the value for each ID |
if value > threshold | Py-Beg L8 | the filter condition |
toolset.execute_action(Action.GOOGLECALENDAR_CREATE_EVENT, {...}) | Auto-Beg L10 | the side effect |
print("step N: ...") | Auto-Beg L20 | step logging |
Counter pattern (sent += 1) | Auto-Beg L17 | report what fired |
No new concepts. The hardest line is the f"alert: {item_id}={value}" interpolation — week 1 of Python Beginner.
Deliberately not in scope for an Auto-Beg synthesis:
values_by_id, not a Sheet)Those are Auto Intermediate. The skill of week 3 is recognizing a 4-primitive shape and writing it cleanly — not trying to anticipate every edge case.
# right — lean, four primitives, clear
for item_id in ids:
value = values_by_id.get(item_id, 0)
if value > threshold:
side_effect(item_id, value)
sent += 1
# wrong — assumes every key is present
for item_id in ids:
value = values_by_id[item_id] # KeyError if missing
# over-shape — too defensive for a 3-item synthesis
try:
for item_id in ids:
try:
value = values_by_id.get(item_id, 0)
...
except Exception as e:
print(f"item {item_id} failed: {e}")
except Exception as e:
print(f"outer failed: {e}")Match the defensiveness to the lesson. For day 19's purpose-built error-chain lesson, the over-shape is right. For today's synthesis, the lean shape is right.
Twenty lessons. Today you stitch four of them together on a tiny generic input. No new APIs.
Given an in-memory list of three IDs ["a", "b", "c"] and a values dict {"a": 5, "b": 15, "c": 20}:
"alert: <id>=<value>".Expected output: alerts fire for b (15) and c (20). a (5) is below threshold, skipped.
values_by_id = {"a": 5, "b": 15, "c": 20}
threshold = 10
ids = ["a", "b", "c"]
print("step 1: walking ids")
sent = 0
for item_id in ids:
value = values_by_id.get(item_id, 0)
if value > threshold:
print(f"step 2: {item_id}={value} above threshold, alerting")
toolset.execute_action(Action.GOOGLECALENDAR_CREATE_EVENT, {
"calendar_id": "primary",
"summary": f"alert: {item_id}={value}",
"start_datetime": "2026-12-31T11:00:00+00:00",
"event_duration_minutes": 15,
})
sent += 1
print(f"step 3: sent {sent} alerts")No new concepts at all?
Zero. Look-up (week 1 dicts), if-on-condition (week 2), side-effect call (week 9), step logging (yesterday). The whole-week skill: assemble these without overthinking.
| Primitive | From | Used for |
|---|---|---|
Dict lookup with .get(key, default) | Auto-Beg L3 (and Py-Beg L15) | reading the value for each ID |
if value > threshold | Py-Beg L8 | the filter condition |
toolset.execute_action(Action.GOOGLECALENDAR_CREATE_EVENT, {...}) | Auto-Beg L10 | the side effect |
print("step N: ...") | Auto-Beg L20 | step logging |
Counter pattern (sent += 1) | Auto-Beg L17 | report what fired |
No new concepts. The hardest line is the f"alert: {item_id}={value}" interpolation — week 1 of Python Beginner.
Deliberately not in scope for an Auto-Beg synthesis:
values_by_id, not a Sheet)Those are Auto Intermediate. The skill of week 3 is recognizing a 4-primitive shape and writing it cleanly — not trying to anticipate every edge case.
# right — lean, four primitives, clear
for item_id in ids:
value = values_by_id.get(item_id, 0)
if value > threshold:
side_effect(item_id, value)
sent += 1
# wrong — assumes every key is present
for item_id in ids:
value = values_by_id[item_id] # KeyError if missing
# over-shape — too defensive for a 3-item synthesis
try:
for item_id in ids:
try:
value = values_by_id.get(item_id, 0)
...
except Exception as e:
print(f"item {item_id} failed: {e}")
except Exception as e:
print(f"outer failed: {e}")Match the defensiveness to the lesson. For day 19's purpose-built error-chain lesson, the over-shape is right. For today's synthesis, the lean shape is right.
Create a free account to get started. Paid plans unlock all tracks.