📅  最后修改于: 2022-03-11 14:45:21.028000             🧑  作者: Mango
def swap_by_temp_var(num1,num2):
temp = num1
num1 = num2
num2 = temp
return num1, num2
def swap_by_mathamatically(num1,num2):
num1 = num1 + num2
num2 = num1-num2
num1 = num1-num2
return num1, num2
print(swap_by_temp_var(100,80))
print(swap_by_mathamatically(100,80))