<div>sith . wrote:<BR>> Hi,<BR>> I've read the posts on comparing 2 lists and couldn't find the answer to<BR>> my question.<BR>> I have 2 lists<BR>> a = [4,3,2,6,7,9]<BR>> b = [8,6,3,3,2,7]<BR>> How can I determine if the elements in a are larger or smaller than the<BR>> elements in b.<BR>> <BR>> for i in a:<BR>> for u in b:<BR>> i > u<BR>> does not return the result I seek.<BR>> <BR>> In this example, 4 from a is compared to 8,6,3,3,2,7 then 3 from a is<BR>> compared to all the elements in b.<BR>> I'd like<BR>> 4 to 8,<BR>> 3 to 6,<BR>> 2 to 3 and so on; like 2 columns in excel, the third column would be a<BR>> new list of boolean values.<BR>> Can someone help please? Thank you.<BR>> </div> <div>all(all(i>j for j in b) for i in a)</div> <div>HTH</div> <div> </div> <div> </div> <div>Hi,<BR>Thanks for
your reply. This is what I get:</div> <div>>>> a = [4,3,2,6,7,9]</div> <div>>>> b = [8,6,3,3,2,7]</div> <div>>>> all(all(i>j for j in b) for i in a)<BR>>>> all(all(i>j for j in b) for i in a)</div> <div>False</div> <div>How do I make it loop through the whole list?</div><p> 
<hr size=1>Never miss a thing. <a href="http://us.rd.yahoo.com/evt=51438/*http://www.yahoo.com/r/hs"> Make Yahoo your homepage.</a>