Tell us what’s happening:
I will need help to solve step 17. I have try interpreting the instruction and have the following :
return (lambda expense: expense[‘amount’], expenses)
Is there anything that I missed? Please help
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"]}')
# User Editable Region
def total_expenses(expenses):
return (lambda expense: expense['amount'], expenses)
# User Editable Region
expenses = []
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Safari/605.1.15
Challenge Information:
Learn Lambda Functions by Building an Expense Tracker - Step 17