title: Move odd and even numbers in list to odd and even positions
body: <p>I have a list with an equal number of odd and even integers. The goal is to modify the list to have odd integers at odd indices and even integers at the even indices. </p>
  
  <p>Here is my approach:</p>
  
  <p>I find out the numbers at even indexes and odd indexes. Then find out odd numbers at even indexes and even numbers at odd indexes. Finally swap the misplaced numbers. </p>
  
  <pre><code>x = [3, 2, 5, 6, 4, 7, 8, 9, 10, 11]
  even_pos = []
  odd_pos = []
  for i in range(len(x)):
      if x[i] % 2 == 0:
          even_pos.append(i)
      else:
          odd_pos.append(i)
  
  even_pos_with_odd = []
  odd_pos_with_even = []
  
  for j in range(len(even_pos)):
      if even_pos[j] % 2 != 0:
          even_pos_with_odd.append(j)
      if odd_pos[j] % 2 == 0:
          odd_pos_with_even.append(j)
  
  for n in range(len(even_pos_with_odd)):
      temp =  x[odd_pos[odd_pos_with_even[n]]]
      x[odd_pos[odd_pos_with_even[n]]] = x[even_pos[even_pos_with_odd[n]]]
      x[even_pos[even_pos_with_odd[n]]] = temp
  </code></pre>
  
  <p>I am not very happy with the solution though it works. Is there any better efficient solution to my problem? My aim was to make <code>x[]</code> like <code>[2, 3, 6, 5, 4, 7, 8, 9, 10, 11]</code> possibly sorted in the same odd-even format.       </p>