title: How to switch position of two items in a Python list?
body: <p>I haven’t been able to find a good solution for this problem on the net (probably because switch, position, list and Python are all such overloaded words).</p>
  
  <p>It’s rather simple – I have this list:</p>
  
  <pre><code>['title', 'email', 'password2', 'password1', 'first_name', 'last_name', 'next', 'newsletter']
  </code></pre>
  
  <p>I’d like to switch position of <code>'password2'</code> and <code>'password1'</code> – not knowing their exact position, only that they’re right next to one another and <code>password2</code> is first.</p>
  
  <p>I’ve accomplished this with some rather long-winded list-subscripting, but I wondered its possible to come up with something a bit more elegant?</p>