title: Compare the elements of a list in python
body: <p>I want to  iterate through a list and want to compare the elements of list. For example: First element will be compared with next element. I've a list a:</p>
  
  <pre><code>for i in range(len(a))
      for i+1 in range(len(a)) #check code
          if a[i] == a[i+1]
             a.pop(i+1)
  </code></pre>
  
  <p>Can anybody suggest how to do this in python?</p>