SOLVED 9. Something of Value


#1



https://www.codecademy.com/courses/python-beginner-en-IZ9Ra/1/4?curriculum_id=4f89dab3d788890003000096#

This error code comes up:
Oops, try again. Your code looks a bit off. Check the Hint if you need help! Your code threw the following error: unsupported operand type(s) for *: 'dict' and 'dict'

I am not sure why it is not working.


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 * stock

print(total)

Thanks so much! :slight_smile:


#2

MIssing index key...

    total += prices[key] * stock [key]

#3

thanks so much!!!!! :slight_smile: