Op 19 jan 2006 vond "[EMAIL PROTECTED]" : > another approach: > > ref = [2,2,4,1,1] > lis = [2,2,5,2,4] > > len([ref.pop(ref.index(x)) for x in lis if x in ref]) >
This is the type of solution I was hoping to see: one-liners, with no use of local variables. As Tim Chase already wrote, it has only one less elegant side: it alters the original ref list. Thanks for your suggestion. -- http://mail.python.org/mailman/listinfo/python-list