Hello!

I desperately need a simple way to compare whether any item of SmallList is in 
BigList.

My current way,

def IsAPartOfList(SmallList,BigList)
for item in SmallList:
    if item in BigList:
        return True
return False

Takes up waay too much time to process.
Can anyone think of any better way?

Usually, SmallList is generated using range(Long, Long+ ~300)
BigList is usually of a few hundreds of long numbers.
The long numbers themselves represent date in seconds-since-the-epoch time. 
(E.G: time.time() is now in seconds-since-the-epoch,
1186739653.4679999
at the time of writing.)

Thank you for your help,
Omer Tabach.
----------------
Now playing: Haggard - Requiem in D-Minor
posted with FoxyTunes    

       
---------------------------------
Looking for a deal? Find great prices on flights and hotels with Yahoo! 
FareChase.
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to