小册名称:Python合辑4-130个字符串操作示例
如何在 Python 中为字符串添加 X 个空格
print('canada'.ljust(10) + 'india'.ljust(20) + 'japan')
Output:
canada india japan