Python variable exchange, no third

xiaoxiao2021-03-06  19

: A Python small TIP, exchanges the value of two variables, and does not use the third variable:

>>> a, b = 1, 2

>>> A, B = B, A

>>> a, b

(twenty one)

>>>

转载请注明原文地址:https://www.9cbs.com/read-42817.html

New Post(0)