title: XOR swap algorithm in python?
body: <p>I tried to implement <a href="http://en.wikipedia.org/wiki/XOR_swap_algorithm" rel="nofollow noreferrer">XOR swap</a> in python.</p>
  
  <pre><code>x,y= 10,20
  
  x,y,x = x^y,x^y,x^y
  
  print('%s , %s'%(x,y))
  </code></pre>
  
  <p>OUTPUT:</p>
  
  <pre><code>30 , 30
  </code></pre>
  
  <p>I am not new to python but I am unable to explain this output. It should have been <code>20,10</code>.</p>
  
  <p>What is going on under the hood?</p>