Learn Lambda Functions by Building an Expense Tracker - Step 16

can’t print in for loop

Your code so far

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

# User Editable Region

def print_expenses(expenses):
    for expense in expenses:
        print(f'Amount: {expense}, Category:{expense}')

# User Editable Region


expenses = []

Your browser information:

User Agent is: Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Mobile Safari/537.36

Challenge Information:

Learn Lambda Functions by Building an Expense Tracker - Step 16

Can anyone solve
it?

Hi, welcome!

You are just missing a space look at the instructions again:

Inside the for loop, replace pass with a print() call and pass it the following f-string: f'Amount: {expense}, Category: {expense}'.

Make sure the spaces in your string are exactly the same.