print("|","Ursula".ljust(20,""),"|") # 左对齐
print("|","Ursula".center(20,""),"|") # 居中对齐
print("|","Ursula".rjust(20,"*"),"|") # 右对齐
运行结果:
| Ursula |
| Ursula |
| Ursula |
————————————————
版权声明:本文为CSDN博主「Anesthesias」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_34613816/article/details/99087407