直接变量值交换

a = 23
b = 42

# 普通方法
tmp = a
a = b
b = tmp

# Oops !
a, b = b, a

Last updated