Unit5. lesson9.Algo de Valor


#1

We will determine how much money you would earn if he sold all their food.

Create a complete call variable and equal to zero.
Scroll through the prices dictionaries.
For each key in prices , multiply the number in prices by the number in stock . View this on the console and then add it to the total.
Finally , out of the loop displays the total ( print total) .

//////
prices = {
"banana" : 4,
"maca" : 2,
"laranja" : 1.5,
"pera" : 3,
}
stock = {
"banana" : 6,
"maca" : 0,
"laranja" : 32,
"pera" : 15,
}

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

total = 0

for key in prices:
prices[key] * stock[key] ##?? How can I do it??
print ##....
print total
/////
error message: Oops, tente outra vez. Parece que seu codigo nao exibiu o total correto


#2

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