第一种放方法
1 In [23]: a,b = 8,10 2 3 In [24]: a 4 Out[24]: 8 5 6 In [25]: b 7 Out[25]: 10 8 9 In [26]: a = a + b 10 11 In [27]: b = a - b 12 13 In [28]: a = a - b 14 15 In [29]: a 16 Out[29]: 10 17 18 In [30]: b 19 Out[30]: 8
第二种方法
1 In [23]: a,b = 8,10 2 3 In [24]: a 4 Out[24]: 8 5 6 In [25]: b 7 Out[25]: 10 8 9 In [26]: a = a + b 10 11 In [27]: b = a - b 12 13 In [28]: a = a - b 14 15 In [29]: a 16 Out[29]: 10 17 18 In [30]: b 19 Out[30]: 8