BuildlyBuildly
DashboardExercisesProfileHelp

Steps

0 / 6
0 / 400 XP

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.

You'll practice

Python ProgrammingLists, Dicts, Sets, TuplesString CleaningConditionals & LoopsFunction Design
Loading kernel…
1

Total spend

40 XP

Easy 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.

Show the data (20 transactions, 6 rule categories)

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.

Karan

Ask Karan

Tech Lead at Tally (personal-finance app)

Currently on: Step 1. Total spend
Karan

Hey, I'm Karan — Tech Lead at Tally (personal-finance app). I'll be working with you on this scenario. Ask me anything — about the data, the brief, the current step, or your code. I won't dump the answer on you, but I'll absolutely point you in the right direction.