Question about food parameter


#1

What’s the food list ?


FAQ: Learn Python: A Day at the Supermarket - Making a Purchase
#2

its a list representing the products a customer wants to buy from your store, one of such possible lists is defined at line 1 (shopping_list)

we can pass different lists at function call as argument


#3

what is wrong in my code ?


#4

your function should work for multiple lists, not ever customer is going to buy the same products. We can represent this different customers with different function calls:

compute_bill(['apple'])
compute_bill(['apple', 'orange'])

#5

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