I am playing with python and am able to get the intersection of two lists:
result = set(a).intersection(b)
Now if d
is a list containing a
and b
and a third element c
, is there an built-in function for finding the intersection of all the three lists inside d
? So for instance,
d = [[1,2,3,4], [2,3,4], [3,4,5,6,7]]
then the result should be
[3,4]
set.intersection(*map(set,d))