Your task for today is to build a function-based expense tracker that records and summarizes spending. This real-world project teaches you how to manage data with lists, design modular functions, and export results — skills that are useful in everyday automation and productivity tools.
📝 Project Task
The program should:
Use a list of dictionaries to store expense records (e.g.,
{"description": "Lunch", "amount": 12.50}
).Define the following functions:
add_expense(description, amount)
→ adds an expense to the loglist_expenses()
→ prints all expenses in a readable tabletotal_expenses()
→ returns the sum of all amountsexport_to_csv(filename)
→ saves the expenses to a.csv
file
Use a loop to let the user choose actions: Add, List, Total, Export, or Quit.
Bonus (optional):
Add a timestamp to each expense.
Format currency to 2 decimal places.
Support categories for each entry (e.g., Food, Travel, Bills).
Save/load expenses from file on program start.
This is a practical app you can actually use — and it reinforces important skills like function design, loops, conditionals, and basic file I/O.
📌 Expected Output
Example interaction:
💬 Join the Weekly Python Chat
Need help or want to share what you built? Join this week’s Python Chat Thread to:
Ask questions
Share your solution
Get feedback
Find study partners
💻 Launch This Project in Colab
Open the interactive Google Colab notebook for today’s project — with full instructions, hints, and solutions.
Click the button below to start coding — no setup needed:
Keep reading with a 7-day free trial
Subscribe to Daily Python Projects to keep reading this post and get 7 days of free access to the full post archives.