+ All Categories
Home > Education > Python programming lab 11

Python programming lab 11

Date post: 22-Jul-2015
Category:
Upload: profbnk
View: 120 times
Download: 3 times
Share this document with a friend
41
Python Programming Lab 11
Transcript

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


Recommended