Advertisement
Guest User

Untitled

a guest
Jan 24th, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.12 KB | None | 0 0
  1. def swap(x, y):
  2.     x = x ^ y
  3.     y = y ^ x
  4.     x = x ^ y
  5.     return x, y
  6.  
  7. a, b = swap(2, 3)
  8. print(a, b) # 3, 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement