title: swapping elements in a for loop returns the same index after swap
body: <p>can someone explain me the loop below:</p>
  
  <pre><code>for item in aList[start:end:1]:
    aList[aList.index(item)],aList[aList.index(item)+1] = aList[aList.index(item)],aList[aList.index(item)+1]
  </code></pre>
  
  <p>Let s say aList = [5,2,3,6,1]. the first iteration the index would 0. in the second would be again 0 and after will be increased to 2. Thus it will choose [5,2] and will continue with [2,5] [3,6].... </p>
  
  <p>Why is that and what is the right way to do this?</p>
  
  <p><strong>UPDATE:</strong> The above is just an example of a specific behavior I wanted to understand. the actual code tries to implement a coctail sort algorithm. 
  The actual code is like that</p>
  
  <pre><code>if f == 1:
          for d in area[start:end:f]:
              print area,f ,d,area[area.index(d)+1],area.index(d)+1
  
              if d &gt; area[area.index(d)+1]:
                  tmp = area.index(d)
                  area[tmp], area[tmp+1] = area[tmp+1],area[tmp]
                  area=area
          end -= 1
          f = ~f + 1
      if f == -1:
  
          for d in area[end:start:f]:
              print area,f,d,area[area.index(d)-1],area.index(d)-1
              if d &lt; area[area.index(d)-1]:
                  tmp = area.index(d)
                  area[tmp], area[tmp-1] = area[tmp-1], area[tmp]
                  area=area
  
          start += 1
          f = ~f + 1
  </code></pre>