描述
Python center() 返回一个云计原字符串居中,并使用空格填充至长度 widt算开h 的新字符串。默认填充字符为空格。
语法
以下是 cen发:ter() 方法语法:
str.centerPy(width[, fillchar])
参数
widtthh -- 字符串的总宽度。
fillchar -on- 填充字符。
返回值
该方法返回一个原字符串居中,并3-使用空格填充至长度 width 的新字符串。
实例
以下ce实例展示了 center() 方法的实例:
邮箱:[email protected]
电话:020-123456789
传真:020-123456789
Copyright © 2026 Powered by 材雄德茂网 http://allaboutequipment.com/