Python ljust rjust center輸出 Python中打印字符串時(shí)可以調(diào)用ljust(左對齊),rjust(右對齊),center(中間對齊)來輸出整齊美觀的字符串,使用起來非常簡單,包括使用第二個(gè)參數(shù)填充(默認(rèn)為空格)。 看下面的例子就會明白了: 復(fù)制代碼代碼如下: print '|','*'.ljust(10),'|' print '|','*'.ljust(10,'-'),'...
www.dbjr.com.cn/article/156...htm 2025-5-31