标签:nbsp 错误 div code turn def pytho 交换 int
方法1:(错误)
def func(a,b): a,b = b,a a = 1 b = 2 func(a,b) print(a," ",b)
方法2:(正确)
def func(a,b): return b,a a = 1 b = 2 a,b = func(a,b) print(a," ",b)
标签:nbsp 错误 div code turn def pytho 交换 int
原文地址:https://www.cnblogs.com/luojianyi/p/9573990.html