Tell us what’s happening:
Can someone please help me with this problem as i am not sure what is i am missing here.
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 sum(map(lambda expenses: expese['amount'], expenses))
# 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/135.0.0.0 Safari/537.36
Challenge Information:
Learn Lambda Functions by Building an Expense Tracker - Step 25
ILM
2
can you describe what test asks you to do?
sure
let me know if you can help me solve the issue
ILM
4
please describe it in your own words, what does it ask you to do?
it want me to run lambda function in total expense and add paramter expense in it can you please look into this?
ILM
6
ok, and do you think you did that?
i am not sure its a quite challenging what i have input there can you please look into this?
ILM
8
You are not sure you created a lambda function?
is that code you wrote yourself? or did you copy it from somewhere?
i wrote it myself but i am not sure how can i go forward in this
ILM
10
if you wrote it yourself, what made you write sum
and map
? where did you find the indication to write those?
i read question very carefully
ILM
12
and what part of it mention using sum
and map
?
in one of the step they want to add sum and map to the code if you feel i am bluffing check 2-3 steps back you will get it
ILM
14
You are wrong, past steps do not want map
and sum
, it’s future steps.
To solve this step you need to do only and exactly what you are asked to do, which is create the lambda function
ok let me try that and will get back to you
got it thanks for the help