Five days, five functions — make_report_line, summarize_channel, parse_campaign_csv, load_campaigns_from_csv, campaigns_to_json. Which one shifted something for you?
The def moment on Day 17. I'd been rewriting that same f-string — rank, channel, spend with a comma, CPL to two decimals — in lesson after lesson. The instant I wrapped it in a named function it felt like... I'd been doing this on purpose all week, and I didn't know it yet.
You had been. Each lesson was building the piece that the function would eventually own. What about the file parsing on Day 19 versus Day 20?
Day 20 was the reveal. I spent Day 19 manually splitting on commas and worrying about what happens if a campaign name has a comma in it. Then csv.DictReader just... handles it. Quoted commas, headers-as-keys, the whole thing. One line.
"One line" is the entire pitch for the standard library. And Day 21?
json.dumps(campaigns, indent=2) — my data, structured, readable, formatted for the CFO's dashboard. I actually texted that output to my manager as proof of concept. One line again.
Six questions — four from this week, two from Week 1 and Week 2 to keep those patterns sharp. Let's confirm the toolkit is solid.
Five days, five functions — make_report_line, summarize_channel, parse_campaign_csv, load_campaigns_from_csv, campaigns_to_json. Which one shifted something for you?
The def moment on Day 17. I'd been rewriting that same f-string — rank, channel, spend with a comma, CPL to two decimals — in lesson after lesson. The instant I wrapped it in a named function it felt like... I'd been doing this on purpose all week, and I didn't know it yet.
You had been. Each lesson was building the piece that the function would eventually own. What about the file parsing on Day 19 versus Day 20?
Day 20 was the reveal. I spent Day 19 manually splitting on commas and worrying about what happens if a campaign name has a comma in it. Then csv.DictReader just... handles it. Quoted commas, headers-as-keys, the whole thing. One line.
"One line" is the entire pitch for the standard library. And Day 21?
json.dumps(campaigns, indent=2) — my data, structured, readable, formatted for the CFO's dashboard. I actually texted that output to my manager as proof of concept. One line again.
Six questions — four from this week, two from Week 1 and Week 2 to keep those patterns sharp. Let's confirm the toolkit is solid.