Loading…
Group related functions together:
# ---- Data Loading ----
def load_data():
passdef parse_data():
pass
---- Data Processing ----
def clean_data():
passdef transform_data():
pass
---- Output ----
def format_report():
passdef save_report():
pass
Create three expense-related functions:
get_total(expenses) - returns sum of all amountsget_by_category(expenses, category) - returns filtered listformat_summary(category, total) - returns formatted stringThen use them to print a summary for "meals" category.
Downloading Python… (one-time, ~10 MB)
This runs entirely in your browser and is cached for next time.