SigmundV wrote: > I think the OP wants to find the intersection of two lists. > list(set(list1) & set(list2)) is indeed one way to achieve this. [i > for i in list1 if i in list2] is another one
Exactly. I was confused on that I wasn't able to have a list in return. The set intersection is the smartest result better than a "for" loop or a comprehension list. Infact the operatin loops are compiled into python, therfore they are the fastest. -- goto /dev/null -- http://mail.python.org/mailman/listinfo/python-list