Question: I am 100% new to python, I know I need to read more but I need to do this task right now that's why I am using python for it. Here is my code:

```
outputList = []

for line in open('cron.log', 'r'):
   m = line[45:47]
   outputList.append(m)

```

So I opened the file, read through lines, and append the 2 chars I need into a list. Now I want to go from the `end` (or `beginning` of the list), comparing the `element` at that position with the `element` right `before` (or `behind`) it. How can I do that? In C++ I would be doing `iterrator`, using `front()`, `pop_front()` or such but I am clueless about python :(

Answer: 
```
#This is from the beginning
for i in range(1, len(outputList)):
    # == could be what ever comparison you want.  Any one in particular?
    if outputList[i] == outputList[i-1]:
        #do whatever you need to do

```
Also you can use something like this:

```
a = [1, 2, 3, 4, 5, 6, 7, 8]
# proceed backward
for x,y in ((a[i],a[i-1]) for i in xrange(len(a)-1,0,-1)):
    if x!= y:
        # do something

```