Learn Lambda Functions by Building an Expense Tracker - Step 15

Tell us what’s happening:

what am I missing in my for loop because I have no clue what I am missing

Your code so far

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

# User Editable Region

def print_expenses(expenses):
    for expenses in print_expenses:
        pass

# 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/133.0.0.0 Safari/537.36

Challenge Information:

Learn Lambda Functions by Building an Expense Tracker - Step 15

create a for loop that iterates over each item in the expenses list. Use expense as the loop variable

You are iterating over print_expenses, which is a variable that does not exist (it’s the name of the function that you’re writing) and you are using expenses as the loop variable.

I suggest you review for loops and functions to make sure you understand them.

https://www.w3schools.com/python/python_for_loops.asp

https://www.geeksforgeeks.org/python-for-loops/

https://www.w3schools.com/python/python_functions.asp

https://www.geeksforgeeks.org/python-functions/