0
「變數太多解壓」
錯誤。任何人都可以幫助我做到這一點,並可能給我一個解釋?
wings_quantity = {
'small' : 8,
'medium' : 14,
'large' : 20,
'half bucket' : 30,
'bucket' : 65,
}
wings_price = {
'small' : 5.99,
'medium' :8.50,
'large' : 14.00,
'half bucket' :20.00,
'bucket' : 55.00
}
for number, key in wings_quantity:
print " "
print "There are "+(str(wings_quantity[number]))+ " wings in a "+(wings_quantity[key])+" size."
print " "
for number, key in wings_quantity:
ppw = wings_quantity[number]/wings_price[number]
print ('The cost per wing in a %s size is $') + ppw %wing_quantity[key]
好吧,我希望它能打印出「(大小)有(數字)翅膀」我知道格式不對,我正在用ipad打字。我該如何做到這一點?我使用2.7。 – cupilot