Learn Lambda Functions by Building an Expense Tracker - Step 20

Tell us what’s happening:

I think there is a problem in how Step 19/20 are stated. Both steps want to utilized a key from the ‘expense’ dictionary, but the only defined dictionary in the code is ‘expenses’, but I can only get the solution by using ‘expense’.

Am I missing something or is this an error that needs to be corrected?

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))
    

# User Editable Region

def filter_expenses_by_category(expenses, category):
    lambda 

# User Editable Region


expenses = []

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:125.0) Gecko/20100101 Firefox/125.0

Challenge Information:

Learn Lambda Functions by Building an Expense Tracker - Step 20

Hi @figfog

expenses is the dictionary
expense is a parameter

Happy coding