目录
回到顶部
if __name__ == '__main__': str1 = '130000' for a in range(100): print(str1 + str(a).zfill(5))
回到顶部
2.1、rjust:右对齐
if __name__ == '__main__': str_1 = ['cscs', 'dad', 'a', 'adasdadadad', 'jdsad', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'] for s in str_1: print(s.rjust(30), ':', '11')
2.2、ljust:左对齐
if __name__ == '__main__': str_1 = ['cscs', 'dad', 'a', 'adasdadadad', 'jdsad', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'] for s in str_1: print(s.ljust(30), ':', '11')
2.3、center:居中对齐
if __name__ == '__main__': str_1 = ['cscs', 'dad', 'a', 'adasdadadad', 'jdsad', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'] for s in str_1: print(s.center(30), ':', '11')