Tell us what’s happening:
I am stuck on lambda function on step 19 in ‘Learn Lambda Functions by Building an Expense Tracker’
They have asked me to do this:
Create a variable named test and assign it a lambda function that takes an x parameter and returns x * 2
I have this:
test = lambda x: x * 2
But the code is not accepted, what is the problem?
Your code so far
def add_expense(expenses, amount, category):
expenses.append({'amount': amount, 'category': category})
def print_expenses(expenses):
for expense in expenses:
# User Editable Region
test = lambda x: x * 2
# 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/129.0.0.0 Safari/537.36
Challenge Information:
Learn Lambda Functions by Building an Expense Tracker - Step 19