Nov-01-2020, 07:55 PM
You have 4 tuples, so actually only 3 comparisons to the previous tuple can be made. I took a stab in the code below. I gave a pass "True" to the first tuple, then for each subsequent tuple compared each element to see if in the prior tuple. If so, print True, if not continue until have checked all the elements in the tuple at which point print False. See if this works for you.
def find_tuple_matches(tuples) : for count, mississippi in enumerate(tuples) : if count == 0: print('False') continue flag = False for tupelo in mississippi : if tupelo in tuples[count-1] : print('True') flag = True break if not flag : print('False') find_tuple_matches([(45,50,30,21), (30,9,56,3), (57,10,21,4), (41,30,50,56)])