import Counter
import collections
import itertools, collections
List1=[('1234', '5678', 9101112, 131415, 161716, 19), ('1234', '5678', 9101112, 131415, 161716, 19), ('1723113685', '1958120268', 704338729, 1310973186, 38760, 80), ('1723113685', '1958120268', 704338729, 1310973186, 38760, 70), ('1234', '5678', 9101112, 131415, 161716, 19), ('19216813', '6311624397', 3851697578, 0, 58816, 80), ('6311624397', '19216813', 2747564191, 3851697579, 890, 58816), ('19216813', '6311624397', 3851697579, 2747564192, 58816, 80), ('1234', '5678', 9101112, 131415, 161716, 19), ('19216813', '6311624397', 3851698039, 2747565640, 58816, 50)]
List2=[('1723113685', '1958120268', 704338729, 1310984130, 38760, 80), ('1723113685', '1958120268', 704338729, 1310985498, 38760, 80), ('1723113685', '1958120268', 704338729, 1310986866, 38760, 80), ('1723113685', '1958120268', 704338729, 1310973186, 38760, 80), ('6311624397', '19216813', 2747564192, 3851697579, 80, 58816), ('19216813', '6311624397', 3851698039, 2747564192, 58816, 80), ('19216813', '6311624397', 3851698039, 2747565640, 58816, 80), ('1234', '5678', 9101112, 131415, 161716, 19), ('19216813', '6311624397', 3851698039, 2747568536, 58816, 80), ('19216813', '6311624397', 3851698039, 2747569984, 58816, 80), ('19216813', '6311624397', 3851698039, 2747571432, 58816, 80), ('19216813', '6311624397', 3851698039, 2747572880, 58816, 80)]
ab=[]
abDict = Counter(ab)
for x in List1:
if x in List2:
ab.append(x)
for key, value in abDict.items():
if value>2:
print key
I want to find all matched elements between list1
and list2
. When I change list1
and list2
with counter, it is not find all element, but only shows match one element.
This could displays all elements, but I can't find how many elements.