In article 6012d69f-b65e-4d65-90c4-f04876853...@googlegroups.com,
Bradley Wright bradley.wright@gmail.com wrote:
Confusing subject for a confusing problem (to a novice like me of course!)
Thx for the help in advance folks
I have (2) dictionaries:
prices = {
banana: 4,
Confusing subject for a confusing problem (to a novice like me of course!)
Thx for the help in advance folks
I have (2) dictionaries:
prices = {
banana: 4,
apple: 2,
orange: 1.5,
pear: 3
}
stock = {
banana: 6,
apple: 0,
orange: 32,
pear: 15
}
Here's my
for key in prices.keys():
print prices[key]*stock[key]
On Sat, May 18, 2013 at 12:19 PM, Bradley Wright
bradley.wright@gmail.com wrote:
Confusing subject for a confusing problem (to a novice like me of course!)
Thx for the help in advance folks
I have (2) dictionaries:
prices = {
On Sat, May 18, 2013 at 2:19 PM, Bradley Wright
bradley.wright@gmail.com wrote:
Confusing subject for a confusing problem (to a novice like me of course!)
Thx for the help in advance folks
I have (2) dictionaries:
prices = {
banana: 4,
apple: 2,
orange: 1.5,
pear: 3
total,amount=0,0
for key in prices.keys():
price=prices[key]*stock[key]
total+=price
print %s %s % (price,total)
--
http://mail.python.org/mailman/listinfo/python-list
total,amount=0,0
for key in prices.keys():
amount=prices[key]*stock[key]
total+=amount
print %s %s % (amount,total)
--
http://mail.python.org/mailman/listinfo/python-list