Tell us what’s happening:
my print call seems t be wrong, the console is not passing me through
print(map(lambda expense: expense[‘amount’],))
- You should call the
map()
function inside thetotal_expenses
function.
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):
print(map(lambda expense: expense['amount'],))
# 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.4.1 Safari/605.1.15
Challenge Information:
Learn Lambda Functions by Building an Expense Tracker - Step 26