title: Python pop() vs pop(0)
body: <p>So the following is confusing me.</p>
  
  <pre><code>#!/usr/bin/python
  
  test = [0, 0, 0, 1, 2, 3, 4, 5, 6]
  test1 = [0, 0, 0, 1, 2, 3, 4, 5, 6]
  
  for _dummy in test:
      if(_dummy == 0):
          test.pop()
  for _dummy in test1:
      if(_dummy == 0):
          test1.pop(0)
  
  print test
  print test1
  </code></pre>
  
  <p>Results</p>
  
  <pre><code>ubuntu-vm:~/sandbox$ ./test.py 
  [0, 0, 0, 1, 2, 3]
  [0, 1, 2, 3, 4, 5, 6]
  </code></pre>
  
  <p>Perhaps, I'm fundamentally misunderstanding how pop is implemented.  But my understanding is that it removes the item at the given index in the list, and returns it. If no index is specified, it defaults to the last item.  So it would seem that in the first loop it should remove 3 items from the left of the list, and in the second loop it should remove 3 items from the end of the list.</p>