-3
這是我的字典
此時它正在更新。如何打印字典{}和'
DictDestination.update({(listDestinations[intCount]): [(" Discount of ${0:.2f}".format(intDiscount)), ("Thats {0:.2f}% off".format(intPercentage)), ("The saver type is {}".format(strSaverType)), ("Your original price was ${0:.2f}".format(intOriginal)), ("Your new price is ${0:.2f}".format(intNew))]})
到目前爲止,我正在使用pprint模塊來打印它,我出來這樣。
{ 'Auckland': [ ' Discount of $1.00',
'Thats 1.00% off',
'The saver type is Quick Saver',
'Your original price was $1.01',
'Your new price is $0.01'],
'Rotarua': [ ' Discount of $1.00',
'Thats 1.00% off',
'The saver type is Quick Saver',
'Your original price was $1.01',
'Your new price is $0.01'],
'Wellington': [ ' Discount of $1.00',
'Thats 1.00% off',
'The saver type is Quick Saver',
'Your original price was $1.01',
'Your new price is $0.01']}
但是我希望它出來像這樣
Auckland : Discount of $1.0
Thats 1.00% off
The saver type is Quick Saver
Your original price was $1.01
Your new price is $0.01
Rotarua : Discount of $1.00
hats 1.00% off
The saver type is Quick Saver
Your original price was $1.01
Your new price is $0.01
Wellington : Discount of $1.00
That's 1.00% off
The saver type is Quick Saver
Your original price was $1.01
Your new price is $0.01
我不知道是否有任何類型的模塊,你可以使用,但任何幫助,將不勝感激的東西。
請記住如何提問。 https://stackoverflow.com/help/how-to-ask – Robert