我有一本字典:
import math
import random
d = {1: ["Spices", math.floor(random.gauss(40, 5))],
2: ["Other stuff", math.floor(random.gauss(20, 5))],
3: ["Tea", math.floor(random.gauss(50, 5))],
10: ["Contraband", math.floor(random.gauss(1000, 5))],
5: ["Fruit", math.floor(random.gauss(10, 5))],
6: ["Textiles", math.floor(random.gauss(40, 5))]
}
我想把它打印出来,这样它就可以很好地与页眉对齐.我是否可以将标题添加到字典中,并始终确保它们位于顶部?
例子:
Key___________________Label______________________Number
1______________________Spices_____________________42
2______________________Other Stuff_____________16
etc
Apparently I can't even do this inside of this editor manually, but I hope the idea comes across.
I also don't really want the __ either. Just a place holder.
Thanks all.