Python ljust rjust center输出
看下面的例子就会明白了: 实现代码如下:print '|','*'.ljust(10),'|' print '|','*'.ljust(10,'-'),'|' print '|','*'.rjust(10,'-'),'|' print '|','*'.center(10,'-'),'|' for a
看下面的例子就会明白了: 实现代码如下:print '|','*'.ljust(10),'|' print '|','*'.ljust(10,'-'),'|' print '|','*'.rjust(10,'-'),'|' print '|','*'.center(10,'-'),'|' for a