Mater Dei Python Code

Monday, March 3, 2014

Supermarket 11/13

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 = 0
for items in food:
total += prices[items]
return total
Posted by Ken Rhines at 7:28 AM
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

About Me

Ken Rhines
View my complete profile

Blog Archive

  • ▼  2014 (92)
    • ►  February (42)
    • ▼  March (50)
      • Supermarket 3/13
      • Supermarket 4/13
      • Supermarket 6/13
      • Supermarket 7/13
      • Supermarket 8/13
      • Supermarket 9/13
      • Supermarket 10/13
      • Supermarket 11/13
      • Supermarket 12/13
      • Teacher 1/9
      • Teacher 2/9
      • Teacher 3/9
      • Teacher 4/9
      • Teacher 5/9
      • Teacher 6/9
      • Teacher 7/9
      • Teacher 8/9
      • Teacher 9/9
      • Lists 1/18
      • Lists 2/18
      • Lists 3/18
      • Lists 4/18
      • Lists 5/18
      • Lists 6/18
      • Lists 7/18
      • Lists 8/18
      • Lists 9/18
      • List 10/18
      • List 11/18
      • List 12/18
      • List 13/18
      • List 14/18
      • List 15/18
      • List 16/18
      • List 17/18
      • List 18/18
      • Battleship 3/19
      • Battleship 4/19
      • Battleship 5/19
      • Battleship 6/19
      • Battleship 7/19
      • Battleship 8/19
      • Battleship 9/19
      • Battleship 10/19
      • Battleship 11/19
      • Battleship 12/19
      • Battleship 13/19
      • Battleship 15/19
      • Battleship 16/19
      • Battleship 17/19
Simple theme. Powered by Blogger.