[EMAIL PROTECTED] a écrit :
> Hi,
> 
> I have to get list of URLs one by one and to find the URLs that I have
> more than one time(can't be more than twice).
> 
> I thought to put them into binary search tree, this way they'll be
> sorted and I'll be able to check if the URL already exist.

What about a set ?

s = set()
for url in urls:
   if url in s:
     print "already have ", url
   else:
     set.add(url)

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to