Three weeks, fifteen functions. This week you stop writing isolated pieces and start composing them into something that looks like a real expense tracker.
Does composition mean I call my own functions from inside other functions?
Exactly. Day 25 is a composition exercise — you filter a list, then check how many items are over a threshold, all inside one function. Day 27 builds a full summary. Day 28 is the capstone — a printable report that uses the accumulator, the dict grouping, sorted, and string joins all in one place.
And the comprehension piece — I keep hearing that word. Is it just a shorthand or something more?
It's a shorthand now, a mental model later. Day 24 shows how a list comprehension can transform as well as filter. The explainer for Day 28 plants the seed for something you'll meet in the next track — a loop you can write in one line is called a comprehension, and once you're fluent in them, they become the default way to express data work.
extract_amounts(txns) — list comprehension as a transformhigh_value_expenses(txns, limit) — compose filter + count in one functionsavings_rate(income, expenses) — round() + zero-denominator guardsummarize_expenses(txns) — total, count, average, by-category, all in one dictbuild_report(txns, title) — the capstone printable reportAhead: comprehensions — loops in one line — are the next track's backbone.
7 lessons this week
Three weeks, fifteen functions. This week you stop writing isolated pieces and start composing them into something that looks like a real expense tracker.
Does composition mean I call my own functions from inside other functions?
Exactly. Day 25 is a composition exercise — you filter a list, then check how many items are over a threshold, all inside one function. Day 27 builds a full summary. Day 28 is the capstone — a printable report that uses the accumulator, the dict grouping, sorted, and string joins all in one place.
And the comprehension piece — I keep hearing that word. Is it just a shorthand or something more?
It's a shorthand now, a mental model later. Day 24 shows how a list comprehension can transform as well as filter. The explainer for Day 28 plants the seed for something you'll meet in the next track — a loop you can write in one line is called a comprehension, and once you're fluent in them, they become the default way to express data work.
extract_amounts(txns) — list comprehension as a transformhigh_value_expenses(txns, limit) — compose filter + count in one functionsavings_rate(income, expenses) — round() + zero-denominator guardsummarize_expenses(txns) — total, count, average, by-category, all in one dictbuild_report(txns, title) — the capstone printable reportAhead: comprehensions — loops in one line — are the next track's backbone.