Build the Functionality
Create the core features of the “Budget Tracker” project in this lesson.
We'll cover the following...
We'll cover the following...
In the previous lesson, you:
Chatted with a simulated client and gathered needs.
Converted notes into functional requirements.
Created a clean skeleton of eight function stubs.
Now we’ll bring it to life. Starting with two core functions, then using AI to scaffold the rest. You’ll also get quick tests and a full reference solution.
Press + to interact
We’ll keep a tiny in-memory data model:
# globals (top of your file)income = 0.0# A list of expense dictionaries, e.g. [{"category": str, "amount": float}, ...]expenses = [] # each entry: {"category": str, "amount": float}
Conventions we’ll use:
Positive amounts only.
Built-ins only, Python, no external libs / file I/O / classes.
Build the basics
We’ll implement add_income
and add_expense
first. These are the heartbeat of the app; everything else plugs into them.
add_income(amount)
Before we start coding our first function, let’s ...