I have the following list
b = [[1,2], [1,3], [2,4], [2,5], [3,4], [3,5], [4,6], [5,6]]
I want to check the condition when second element of list b is equal to its first element.
len_b = len(b);
for i in range(0, len_b):
if b[i][1] == b[0][i]:
print 'anything'
but, whenever I execute this I have the IndexError: list index out of range.
b[0][i]should beb[i][0]