[Tutor] Testing if a number occurs more than once

Scot Stevenson scot@possum.in-berlin.de
Tue Dec 3 07:21:02 2002


Hello Fred, 

> duplicates = filter((lambda x:list.count(x)>1), list)

If I understood the previous posters here, the "list.count" part is the 
problem, because it goes thru the whole list every time, which is expensive. 
Or doesn't this apply here?

Y, Scot


-- 
  Scot W. Stevenson -- scot@possum.in-berlin.de -- Zepernick, Germany