
Tally Statement Categorizer
Categorise raw bank-transaction merchant names into buckets like food, transport, rent — then roll them up into a monthly summary.
You're an analyst at Tally, a personal-finance app for the Indian market. The first monthly-statement feature ships Friday — users connect their bank, Tally pulls transactions, and the app tells them: "You spent ₹X this month, mostly on Y." The whole feature rides on the categoriser.
The keyword-rules dict is already sketched out — your job is to wire it up and run it over April's transactions before the feature goes near a real user. Six steps, ~2 hours.
What you'll practice: lists, dicts, sets, string cleaning, conditionals, loops, function design.
You'll practice
Total spend
40 XPEasy warmup: what's the total spend across the April statement?
Walk every transaction, add its amount to a running total, and assign the result to total_spend.
Done when: total_spend is the sum of every transaction's amount.
Each transaction is a dict: {date, merchant, amount, raw_description}
Sample row: {"date": "2026-04-02", "merchant": " Zomato ", "amount": 480.0, "raw_description": "ZOMATO ORDER #4521"}
Rule categories: food, transport, groceries, bills, entertainment, rent — each maps to a list of lowercased keyword substrings (e.g. food → ["zomato", "swiggy", "starbucks"]).
The full data is defined in cell 1.
</details>