Learn Lambda Functions by Building an Expense Tracker - Step 23

Tell us what’s happening:

I’ve tried a bunch of different things but nothing is working. What am I missing here?

Your code so far

def add_expense(expenses, amount, category):
    expenses.append({'amount': amount, 'category': category})
    
def print_expenses(expenses):
    for expense in expenses:
        print(f'Amount: {expense["amount"]}, Category: {expense["category"]}')
    
def total_expenses(expenses):
    return sum(map(lambda expense: expense['amount'], expenses))
    
def filter_expenses_by_category(expenses, category):
    return filter(lambda expense: expense['category'] == category, expenses)

# User Editable Region

def main(expenses)
expenses = []

# User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36

Challenge Information:

Learn Lambda Functions by Building an Expense Tracker - Step 23

What else did you try?

This function does not look like all of the other functions above it.

Also, make note:

without parameters.

I was able to solve this one. Thanks for the tip.

i was able to pass this part