Thank you Kent, Michael, Tom and anyone else I'm forgetting who took time to reply.<br><br>I don't work quite so fast, very limited personal computer time means I only do it on weekends,<br><br>I read through your suggestions and eventually found a way to speed-up the proccess through sorting the Two lists, then manually iterating through each of them. This way I've completely canceled the need to compare Two lists: instead just ensuring I start from a point not taken in One list and having to only check whether Item not in BigList.<br><br>[If anyone's interested, I should have the script finished and thoroughly tested on, ah, next weekend, and I could post a link here.]<br><br>Again, Thx.<br>-Omer.<br><blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>Message: 1<br>Date: Fri, 10 Aug 2007 08:11:47 -0400<br>From: Kent Johnson <kent37@tds.net><br>Subject: Re: [Tutor] Simple way to compare Two lists<br>To: Tom
Fitzhenry <tomfitzyuk@gmail.com>, tutor@python.org<br>Message-ID: <46BC5603.9060703@tds.net><br>Content-Type: text/plain; charset=ISO-8859-1; format=flowed<br><br>Tom Fitzhenry wrote:<br>> On Fri, Aug 10, 2007 at 02:54:44AM -0700, Jaggo wrote:<br>>> Can anyone think of any better way?<br>> <br>> If SmallList and BigList are sorted (in order), there is a faster method:<br>> <br>> def IsAPartOfList(SmallList,BigList):<br>> for i in BigList:<br>> for j in SmallList:<br>> if i==j:<br>> return true<br>> if i>j:<br>> break<br>> return false<br>> <br>> (I'm not sure how encouraged using break statements are, so wait for a tutor to<br>> answer)<br><br>break is fine! If the list you are searching is sorted you can use the <br>bisect module to do a binary search instead of the linear search above.<br><br>> If one list is already sorted but the other
isn't, it may still be faster to<br>> sort the unsorted list then use the method above.<br><br>I don't think BigList has to be sorted in the above algorithm. If both <br>lists are sorted I suppose you could write it like a merge sort, walking <br>along both lists looking for a match.<br><br>Kent<br><br></tomfitzyuk@gmail.com></kent37@tds.net></blockquote><br><p> 
<hr size=1>Park yourself in front of a world of choices in alternative vehicles.<br><a href="http://us.rd.yahoo.com/evt=48246/*http://autos.yahoo.com/green_center/;_ylc=X3oDMTE5cDF2bXZzBF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFncwRzbGsDZ3JlZW4tY2VudGVy">Visit the Yahoo! Auto Green Center.</a>