Something of value


#1


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

I'm bit lost with this one.... Can anyone help?


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

def total():
    total == 0

for key in prices:
    print key
    print "price: %s" % prices[key]
    print "stock: %s" % stock[key]
    total = total + %prices[key] * %stock[key]
    

print total


#2

here:

def total():
    total == 0

why a function? And why two equal signs? (which means check if equal), why would you do this here?


#3

5 posts were split to a new topic: Something of value


#8

Oops! Brain freeze I guess.


#9

All sorted now or do you need more help? If you need more help, post an updated version of your code


#10

All is well in the kingdom!


#11