Suppose I have a list of lists of elements which are all the same (i\'ll use ints in this example)
int
[range(100)[::4], range(100)[::3], range(100)
I think the built-in set module should do the trick.
set
>>> elements = [range(100)[::4], range(100)[::3], range(100)[::2], range(100)[::1]] >>> sets = map(set, elements) >>> result = list(reduce(lambda x, y: x & y, sets)) >>> print result [0, 96, 36, 72, 12, 48, 84, 24, 60]