If you have a list in python like this: list1 = [(1,2), (3,1), (4,1), (1,2), (3,1)] If you have list1 in python and you want to find if two pairs of consecutive values in a