Como alinhar corretamente os dados numéricos?
Eu tenho alguns dados que estou exibindo no formato de 3 colunas, da forma:
key: value key: <tab> key: value <tab> key: value
.
Aqui está um exemplo:
p: 1 sl: 10 afy: 4
q: 12 lg: 10 kla: 3
r: 0 kl: 10 klw: 3
s: 67 vw: 9 jes: 3
t: 16 uw: 9 skw: 3
u: 47 ug: 9 mjl: 3
v: 37 mj: 8 lza: 3
w: 119 fv: 8 fxg: 3
x: 16 fl: 8 aew: 3
No entanto, gostaria que os números fossem alinhados corretamente, como:
a: 1
b: 12
c: 123
Como posso fazer isso em Python?
Aqui está o código de impressão existente que tenho:
print(str(chr(i+ord('a'))) + ": " + str(singleArray[i]) + "\t" +
str(doubleArray[i][0]) + ": " + str(doubleArray[i][1]) + "\t" +
str(tripleArray[i][0]) + ": " + str(tripleArray[i][1]))