python3 format()格式化函数
程序员文章站
2022-07-15 07:53:34
...
a = "Python"
b = "="
c = ">"
print("{0:{1}{3}{2}}".format(a, b, 25, c))
print("{0:=>25}".format(a, b, 25, c))
{0(format参数索引):(相当于python2中的%)=(空格处填充)>(’:'前的东西右对齐)25(最小宽度)}