title: Python Swap two digits in a number?
body: <p>What is the fastest way to swap two digits in a number in Python?  I am given the numbers as strings, so it'd be nice if I could have something as fast as</p>
  
  <pre><code>string[j] = string[j] ^ string[j+1] 
  string[j+1] = string[j] ^ string[j+1]
  string[j] = string[j] ^ string[j+1]
  </code></pre>
  
  <p>Everything I've seen has been much more expensive than it would be in C, and involves making a list and then converting the list back or some variant thereof.</p>