Advertisement
Guest User

Untitled

a guest
Aug 27th, 2014
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. total = 0 #crie uma variável chamada total e iguale a 0
  2.  
  3. for key in prices: #percorra o dicionário prices
  4. print prices[key]*stock[key] #para cada chave em prices multiplique pelo valor em estoque e exiba no console
  5. total += prices[key]*stock[key] #some o valor ao total
  6.  
  7. print total #finalmente imprime o valor de total fora do laço for
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement