← Back to Day 6 Lesson

💰 Expense Tracker

Track your expenses and save them forever!

Add New Expense

Expense Analysis

Python Code Example

Here's how you'd handle expenses in Python:

# List to store expenses expenses = [] # Add an expense (dictionary) expense = { "amount": 25.50, "category": "Food", "description": "Lunch at cafe", "date": "2026-02-24" } expenses.append(expense) # Calculate total total = sum(e["amount"] for e in expenses) print(f"Total: ${total:.2f}") # Save to file import json with open("expenses.json", "w") as f: json.dump(expenses, f, indent=2)

Try the Python terminal version for the full experience!

💡 What This Teaches