字串位置

#20字串空間
print('|','test'.ljust(20),'|')#靠左
print('|','test'.rjust(20),'|')#靠右
print('|','test'.center(20),'|')#置中

0 意見:

張貼留言