我無法在貨幣格式($ 0000.00)顯示列表到一定十進制 - Python 3.x都有
priceList = [1,2,3,4,5,6,7,8,9,10]
for i in range (10):
priceList[i] = random.uniform(1,1000)
print (priceList)
顯示我的列表。如果我嘗試
print ('%.02d' %(priceList))
的Python返回
TypeError: %d format: a number is required, not list
您的預期輸出是什麼? –