How did you manage to screw up such a simple task? List / array indices start at 0, so if you reach array[len(array)] returns an error, while array[len(array)-1] does not. ALSO, if you really wanted to iterate through each element of a list, use the code:
a = [1, 2, 3, 4, 5]
for i in a:
print(i)