11. Making a Purchase


def compute_bill(food):
for item in food:
total= total+prices[item]
return total

need=["apple", "banana"]
print compute_bill(need)

What I do wrong here? Any help?

Replace this line with your code. Do not remove the backticks that are above or below this line.


there is no indent at all in your code? Python relies on indent

I did the markup for you this time, next time do it yourself, read here:

How to


I don' t know very good english... You mean, that I need to post my code, with idents and backticks?


you need the backticks for the indent to show up, without the indent i can't help you.

I did this for you in your original topic, but there was no indent


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.