Learn Lambda Functions by Building an Expense Tracker - Step 12

Tell us what’s happening:

Idk what’s wrong with my code, i can’t see the issue. The error I’m getting is:

Sorry, your code does not pass. Hang in there.

You should pass {'amount': amount} as the argument to the .append() method.

Your code so far


# User Editable Region

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

# 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/126.0.0.0 Safari/537.36 Herond/126.0.6478.126

Challenge Information:

Learn Lambda Functions by Building an Expense Tracker - Step 12

Can you talk about why that error message is confusing you?

It appears that you aren’t doing this?

1 Like

I was regretting doing engineering over a simple error…damn. Thankyou, it worked!

Time, patience, and practice! We all make mistakes

1 Like