Capstone 1 · Levels I to II

The Community Ledger

A neighbourhood bookstore and cafe needs to understand a week of trading. Build a ledger that records every transaction as a structured record, then answers the questions the owner actually asks: what did we take in, which product line carried the week, what was the quietest day, and what would a five percent price rise have done to the total. The point is not arithmetic, it is turning a vague business question into a precise, answerable one.

Concepts used

VariablesNumbers and roundingStrings and templatesLists and dictionariesLoopsConditionals

Your dataset

At least twenty transactions across seven days and three product categories.

Milestones

1Model one transaction as a record with day, category, item, quantity, and unit price.
2Compute the total for a single transaction, then for the whole week.
3Group takings by category and by day, and report both.
4Find the best and worst day, and the strongest category.
5Apply a five percent price rise to one category only and report the difference.
6Print a formatted receipt-style report with aligned currency to two decimal places.

The graded core

The rest of this project is yours to shape. This one function is the piece everything else depends on, so it runs against hidden tests to prove it is right before you build outward.

◈ Graded Challenge

The core of the ledger. Write a function that takes a list of transactions (each with qty and price) and returns the grand total, rounded to two decimal places.

Name it exactly: def ledger_total(transactions):

3 visible + 2 hidden
loading editor…

Your workspace

Build the full project here. Work through the milestones in order, in both languages.

SANKOFA SANDBOX
loading editor…
Your turn → Build it in Python first, then rebuild it in JavaScript. The logic transfers, only the syntax changes.
← All projectsNext: The Archive Keeper