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:

```
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)

```

Can anybody suggest how to do this in python?