11. Making a Purchase


#1

def compute_bill(food):
total=0
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.


#2

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


#3

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


#4

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


#5

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