Learn Lambda Functions by Building an Expense Tracker - Step 26

Tell us what’s happening:

i tried to passs the task but i cant, i am think i did it right , but can u just look for mistakes,

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):
    map(lambda expenses: expense['amount'], expense)



# User Editable Region


expenses = []

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36

Challenge Information:

Learn Lambda Functions by Building an Expense Tracker - Step 26

Hi there,

Your code is close, but there’s a small issue with the variable names. The lambda parameter and the iterable argument should be consistent, one should be singular and the other plural. Make sure to use the correct singular and plural forms. Double-check that, and you’ll be all set!

thanks that really helped, i just could not figure it out