Learn Lambda Functions by Building an Expense Tracker - Step 12

Tell us what’s happening:

This is for step 12 in the Learn Lambda Functions by Building an Expense tracker. Not sure what I’m missing here, I initialized the dictionary and added it to the expenses variable through the append call. Thanks

Your code so far


# User Editable Region

def add_expense(expenses, amount, category):
    my_dict = {'amount' : amount}
    expenses.append(my_dict)

# User Editable Region


expenses = []

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36

Challenge Information:

Learn Lambda Functions by Building an Expense Tracker - Step 12

do not create a new variable, create the dictionary directly as argument of the function

1 Like

Thanks for the fast response