"Jay Tee" <[EMAIL PROTECTED]> writes: > >>> l1= [3, 4, 7, 2] > >>> l2 = [2, 3] > >>> l2 = [2, 3, 99] > >>> l1 & l2 > Traceback (most recent call last): > File "<stdin>", line 1, in ? > TypeError: unsupported operand type(s) for &: 'list' and 'list' > > what am I missing?
They are sets, not lists. from sets import Set as set # use in 2.3 and earlier l1= set([3, 4, 7, 2]) l2 = set([2, 3]) l2 = set([2, 3, 99]) print l1 & l2 -- http://mail.python.org/mailman/listinfo/python-list