Contact: aviboots(AT)netvision.net.il
39,926 questions
51,859 answers
573 users
tpl1 = (3, 7, 9, 0, 2, 1) tpl2 = (2, 8, 6, 3) intersection = tuple(set(tpl1) & set(tpl2)) print(intersection) ''' run: (2, 3) '''
tpl1 = ((0, 1), (2, 1), (3, 4), (9, 5), (7, 8)) tpl2 = ((9, 1), (7, 8), (3, 4), (0, 6), (7, 8)) intersection = tuple(set(tpl1) & set(tpl2)) print(intersection) ''' run: ((3, 4), (7, 8)) '''