20191129字符串对齐方法

左对齐

list=['http://c.biancheng.net/python/','http://c.biancheng.net','https://www.baidu.com/']
for s in list:
    print(s.ljust(35))

 

右对齐

list=['http://c.biancheng.net/python/','http://c.biancheng.net','https://www.baidu.com/']
for s in list:
    print(s.rjust(35))

posted @ 2019-11-29 10:41  虎皮猫  阅读(301)  评论(0编辑  收藏  举报