This works with 1 or more lists and does not use several parameters:
>>> def intersection(*listas): ... return set(listas[0]).intersection(*listas[1:]) ... >>> intersection([1,2,3,4],[4,5,6],[2,4,5],[1,4,8]) set([4]) >>> intersection([1,2,3,4]) set([1, 2, 3, 4]) >>>
Not sure if this is better than the other answers. Anyway.
joaquin
source share