Python programming lab 11

41
Python Programming Lab 11

Transcript of Python programming lab 11

Python Programming

Lab 11

shopping_list = ["banana", "orange", "apple"]

stock = {"banana": 6,"apple": 0,"orange": 32,"pear": 15

}

prices = {"banana": 4,"apple": 2,"orange": 1.5,"pear": 3

}

# Write your code below!def compute_bill(food):

total = 0for price in food:

if stock[price] > 0:total += prices[price]stock[price] -= 1

return total