Python 3 字符串类型:10
# 字符串占用20个字符空间,居中显示,空白处用 "*" 填充
print('>> {:*^20s} <<'.format('welcome'))
# 字符串占用20个字符空间,右对其,空白处用 "*" 填充
print('>> {:*>20s} <<'.format('welcome'))
# 字符串占用20个字符空间,左对齐,空白处用 "*" 填充
print('>> {:*<20s} <<'.format('welcome'))
INFO
# 字符串占用20个字符空间,居中显示,空白处用 "*" 填充
print('>> {:*^20s} <<'.format('welcome'))
# 字符串占用20个字符空间,右对其,空白处用 "*" 填充
print('>> {:*>20s} <<'.format('welcome'))
# 字符串占用20个字符空间,左对齐,空白处用 "*" 填充
print('>> {:*<20s} <<'.format('welcome'))