[python]字符串的ljust方法

ljust用法:

string.ljust(number,'x')

格式化输出字符串,按照number数量调整字符串的总长度,ljust是左对齐,‘x’是填充字符,默认是空格

类似的还有rjust,center

 

posted @ 2014-03-18 11:11  silence.li  阅读(571)  评论(0编辑  收藏  举报