Five more functions. filter_complete_responses, score_per_response, find_first_low_score, group_by_demographic, demographic_summary. Which one changed how you think about data?
group_by_demographic. Realising a dict is just a pivot table that runs in code — I can change the grouping field with one argument instead of rebuilding the whole pivot.
And it reuses is_valid_response from Week 1. That's what composability means — functions built for one purpose slot into the next without rewriting. What about the while loop?
find_first_low_score made sense once I saw the break. Stop the loop when you've found what you need — no wasted iterations over the remaining 490 rows.
Early exit is one of the things loops give you that Excel formulas never did. Six questions across both weeks.
Ready.
Two of these questions revisit Week 1 concepts — keep those functions sharp, you'll need them all the way to Week 4.
Five more functions. filter_complete_responses, score_per_response, find_first_low_score, group_by_demographic, demographic_summary. Which one changed how you think about data?
group_by_demographic. Realising a dict is just a pivot table that runs in code — I can change the grouping field with one argument instead of rebuilding the whole pivot.
And it reuses is_valid_response from Week 1. That's what composability means — functions built for one purpose slot into the next without rewriting. What about the while loop?
find_first_low_score made sense once I saw the break. Stop the loop when you've found what you need — no wasted iterations over the remaining 490 rows.
Early exit is one of the things loops give you that Excel formulas never did. Six questions across both weeks.
Ready.
Two of these questions revisit Week 1 concepts — keep those functions sharp, you'll need them all the way to Week 4.