Day at the Supermarket: Correct code with wrong answers?


#1

The website lets my code below pass as successful, but the answers are incorrect. Can someone please advise?

prices = {
"banana" : 4,
"apple" : 2,
"orange" : 1.5,
"pear" : 3,
}
stock = {
"banana" : 6,
"apple" : 0,
"orange" : 32,
"pear" : 15,
}

for key in prices:
print key
print "price: %s" % prices[key]
print "stock: %s" % stock[key]

total = 0
for key in prices:
total = prices[key] * stock[key] + total
print total

48.0
93.0
117.0
117.0

The answer I get for bananas is 48 but 6*4 = 24.


#2

117 - 93 = 24


#3

4*6 = 24
2*0 = 0
1.5*32 = 32+16 = 48
3*15 = 45

The orange stock price is at 48.
It doesn't print the banana stock price, but the total is correct.