Learn Lambda Functions by Building an Expense Tracker - Step 4

Tell us what’s happening:

I can’t figure out what I’m doing wrong, if someone could point me in the right direction that would be great

Your code so far


# User Editable Region

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

# 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

Challenge Information:

Learn Lambda Functions by Building an Expense Tracker - Step 4

Hello and welcome to the forum!

I believe the value is wrong in your equation.
Do the instructions state it should be 50.00 or is that the example for the equation?
As well, when calling it back in the .append() it may require everything in the curly brackets.
Example: {‘key’: value}
cost.append({‘key’: value})

Hope this helps you.

Thank you! That helped!

1 Like

You are welcome! Happy I could help you.

Keep up the good progress! :slightly_smiling_face:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.