I have already gone through a post but I want to know what I did wrong in my code while using for
loop.
List a
given as:
a = [2, 4, 7,1,9, 33]
All I want to compare two adjacent elements as :
2 4
4 7
7 1
1 9
9 33
I did something like:
for x in a:
for y in a[1:]:
print (x,y)