a = "输出的内容" b = "=" c = ">" print("{0:{1}{3}{2}}".format(a, b, 10, c)) 输出为: =====输出的内容 输出的内容右对齐,预留10个位置,空的地方用=号补齐