Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #45494

Re: Two Dictionaries and a Sum!

Newsgroups comp.lang.python
Date 2013-05-17 22:22 -0700
References <6012d69f-b65e-4d65-90c4-f04876853f5e@googlegroups.com>
Message-ID <c954581b-fa06-41ab-8d02-833269369cc5@googlegroups.com> (permalink)
Subject Re: Two Dictionaries and a Sum!
From nanobio <hektorlg@gmail.com>

Show all headers | View raw


total,amount=0,0
for key in prices.keys():
    amount=prices[key]*stock[key]
    total+=amount
    print "%s %s" % (amount,total)

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Two Dictionaries and a Sum! Bradley Wright <bradley.wright.biz@gmail.com> - 2013-05-17 21:19 -0700
  Re: Two Dictionaries and a Sum! Spacelee <fjctlzy@gmail.com> - 2013-05-18 12:30 +0800
  Re: Two Dictionaries and a Sum! nanobio <hektorlg@gmail.com> - 2013-05-17 22:20 -0700
  Re: Two Dictionaries and a Sum! nanobio <hektorlg@gmail.com> - 2013-05-17 22:22 -0700
  Re: Two Dictionaries and a Sum! Chris Angelico <rosuav@gmail.com> - 2013-05-18 15:10 +1000
  Re: Two Dictionaries and a Sum! Roy Smith <roy@panix.com> - 2013-05-18 09:22 -0400

csiph-web