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 🙁
1 Answer