(1)< (默認)左對齊、> 右對齊、^ 中間對齊、= (只用於數字)在小數點后進行補齊
(2)取位數“{:4s}”、"{:.2f}"等
1 >>> print('{} and {}'.format('hello','world')) # 默認左對齊
2 hello and world
3 >>> print('{:10s} and {:>10s}'.format('hello','world')) # 取10位左對齊,取10位右對齊
4 hello and world
5 >>> print('{:^10s} and {:^10s}'.format('hello','world')) # 取10位中間對齊
6 hello and world
7 >>> print('{} is {:.2f}'.format(1.123,1.123)) # 取2位小數
8 1.123 is 1.12
9 >>> print('{0} is {0:>10.2f}'.format(1.123)) # 取2位小數,右對齊,取10位
10 1.123 is 1.12