Week 1 was about shaping one expense. Week 2 is about handling many, asking questions about each one, and dealing with the fact that real data sometimes breaks.
When you say "breaks," what do you mean — wrong types, missing fields?
Both. A CSV row with "N/A" where a number should be. A line with no commas. Day 13 is where you learn try/except — the Python pattern that lets a function attempt a parse and recover gracefully when the input is garbage.
And the other four lessons — what's the spine of the week?
Decisions first. Day 10 returns a boolean. Day 11 picks one of three labels. Day 12 sums a list with a for loop. Day 14 counts matches. By Friday you can ask "is this over budget", "which bucket does this fall in", and "how many like this did I have" — all on a real list.
is_over_budget(spent, limit)if/elif/elsefor loop (the accumulator pattern)try/except for safe float parsingGoal: shift from one item to many, and from "clean input" to "real input".
7 lessons this week
Week 1 was about shaping one expense. Week 2 is about handling many, asking questions about each one, and dealing with the fact that real data sometimes breaks.
When you say "breaks," what do you mean — wrong types, missing fields?
Both. A CSV row with "N/A" where a number should be. A line with no commas. Day 13 is where you learn try/except — the Python pattern that lets a function attempt a parse and recover gracefully when the input is garbage.
And the other four lessons — what's the spine of the week?
Decisions first. Day 10 returns a boolean. Day 11 picks one of three labels. Day 12 sums a list with a for loop. Day 14 counts matches. By Friday you can ask "is this over budget", "which bucket does this fall in", and "how many like this did I have" — all on a real list.
is_over_budget(spent, limit)if/elif/elsefor loop (the accumulator pattern)try/except for safe float parsingGoal: shift from one item to many, and from "clean input" to "real input".