Im having a hard time comprehending the directions.
Here are the directions:
Make the following changes to your compute_bill function:
1.While you loop through each item of food, only add the price of the item to total if the item's stock count is greater than zero.
2.If the item is in stock and after you add the price to the total, subtract one from the item's stock count.
I got the first part but the second part im confused on it.
Here is my code:
def compute_bill(food): total = 0 for item in food: if stock[item] >0 total += prices[item] return total
I appreciate the help.