<br><br><div class="gmail_quote">On Wed, Nov 18, 2009 at 5:03 PM, Bill Campbell <span dir="ltr"><<a href="mailto:bill@celestial.net">bill@celestial.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">
<br>
</div>When I have had to deal with large lists, I have found that using<br>
an intermediate dictionary can save huge amounts of time.<br>
Something like:<br>
<br>
dict2 = {}.fromkeys(list2)<br>
for x in list1:<br>
if x not in dist2:<br>
dict2[x] = True<br>
<br>
list2 = dict2.keys()<br>
<br></blockquote><div>This is really just a round-about way of using sets.<br>I don't really want to give a code-sample unless he's confirmed he's not doing this as homework, but the set version is much more simple (shorter code that makes more sense) and extremely quick as well. If you're interested in it, Bill, reply to me off-list and I'll send it to you.<br>
</div></div><br>-Luke<br>