Picture your last invoice. Five fields: client name, hourly rate, hours worked, total, payment terms. You type them manually every time. What happens when you have six clients and it's the last day of the month?
I open six documents, update the numbers, pray I didn't copy the wrong rate. It takes two hours.
This week Python holds every field as a named variable. Change rate = 120.0 once and every invoice that references it updates. An f-string renders the formatted line — no TEXT() formula, no manual dollar signs. A simple if/elif/else flags projects that have gone over hours.
So by the end of the week I can format one clean invoice line from code instead of typing it?
Exactly that. Five short functions, each adding one layer. Day 3 formats one invoice label. Day 4 normalises a messy client name from a CRM export. Day 5 builds a full billing summary with two decimal places. Day 6 checks whether hours exceeded the budget. Day 7 categorises a project as on track, over by 10 percent, or critical. By the end you have the raw pieces of the monthly invoice generator you will finish in Week 4.
format_invoice_line(name, rate) — your first f-string with :.2fclean_client_name(raw) — string normalisation with .strip(), .lower(), .replace()format_billing_summary(client, hours, rate) — multi-field string formattingis_over_hours(actual, budgeted) — boolean comparisons and return valuescategorize_project_status(actual, budgeted) — if/elif/else for three-tier logicGoal: by the end of the week you can format any invoice field as a clean string and flag over-budget projects with a single function call.
7 lessons this week
Picture your last invoice. Five fields: client name, hourly rate, hours worked, total, payment terms. You type them manually every time. What happens when you have six clients and it's the last day of the month?
I open six documents, update the numbers, pray I didn't copy the wrong rate. It takes two hours.
This week Python holds every field as a named variable. Change rate = 120.0 once and every invoice that references it updates. An f-string renders the formatted line — no TEXT() formula, no manual dollar signs. A simple if/elif/else flags projects that have gone over hours.
So by the end of the week I can format one clean invoice line from code instead of typing it?
Exactly that. Five short functions, each adding one layer. Day 3 formats one invoice label. Day 4 normalises a messy client name from a CRM export. Day 5 builds a full billing summary with two decimal places. Day 6 checks whether hours exceeded the budget. Day 7 categorises a project as on track, over by 10 percent, or critical. By the end you have the raw pieces of the monthly invoice generator you will finish in Week 4.
format_invoice_line(name, rate) — your first f-string with :.2fclean_client_name(raw) — string normalisation with .strip(), .lower(), .replace()format_billing_summary(client, hours, rate) — multi-field string formattingis_over_hours(actual, budgeted) — boolean comparisons and return valuescategorize_project_status(actual, budgeted) — if/elif/else for three-tier logicGoal: by the end of the week you can format any invoice field as a clean string and flag over-budget projects with a single function call.