How can one easily find the common values between more than two lists?
Exemple:
Lists to match:
L1 = [1,2,3,4,5]
L2 = [4,5,6,7,8]
L3 = [9,10,11,12,4]
L4 = [13,10,12,4]
Would return:
L5 = [4]
Note: something like the following code would take far too long:
def search(a,b,c,d):
my_list=[]
for i in a:
for i in b:
for i in c:
for i in d:
if i in a and i in b and i in c and i in d:
id_sel.append(i)
return (my_list)
Note: something like the following code would be appreciated:
my_list=list(set(a).intersection(b))