[Tutor] Faster list searching?

GoodPotatoes goodpotatoes at yahoo.com
Wed Nov 18 22:51:35 CET 2009


I'm dealing with bigger lists than I have been, and noticed this is getting really slow.  Is there a faster way to do this?

for x in list1:
    if x not in list2:
        list3.append(x)

My search is taking up to 5 minutes to complete.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20091118/753ca19a/attachment.htm>


More information about the Tutor mailing list