print可以在需要輸出的內容的最后芍碧,添加end和sep來定制一個print打印完成后默認的輸出內容和一個print打印多個內容的時候多個內容之間的間隔
print(1111,end = ' ')
print(2222,end = '+')
print(3333,end = '%')
輸出結果: 1111 2222+3333%
print(1,1,1,sep = '-')
輸出結果: 1-1-1
數據交換
a,b = b,a
print(1111,end = ' ')
print(2222,end = '+')
print(3333,end = '%')
輸出結果: 1111 2222+3333%
print(1,1,1,sep = '-')
輸出結果: 1-1-1
a,b = b,a