<div>sith . wrote:<BR>&gt; Hi,<BR>&gt; I've read the posts on comparing 2 lists and couldn't find the answer to<BR>&gt; my question.<BR>&gt; I have 2 lists<BR>&gt; a = [4,3,2,6,7,9]<BR>&gt; b = [8,6,3,3,2,7]<BR>&gt; How can I determine if the elements in a are larger or smaller than the<BR>&gt; elements in b.<BR>&gt;&nbsp; <BR>&gt; for i in a:<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; for u in b:<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; i &gt; u<BR>&gt; does not return the result I seek.<BR>&gt; <BR>&gt; In this example, 4 from a is compared to 8,6,3,3,2,7 then 3 from a is<BR>&gt; compared to all the elements in b.<BR>&gt; I'd like<BR>&gt; 4 to 8,<BR>&gt; 3 to 6,<BR>&gt; 2 to 3 and so on; like 2 columns in excel, the third column would be a<BR>&gt; new list of boolean values.<BR>&gt; Can someone help please?&nbsp; Thank you.<BR>&gt; </div>  <div>all(all(i&gt;j for j in b) for i in a)</div>  <div>HTH</div>  <div>&nbsp;</div>  <div>&nbsp;</div>  <div>Hi,<BR>Thanks for
 your reply.&nbsp; This is what I get:</div>  <div>&gt;&gt;&gt; a = [4,3,2,6,7,9]</div>  <div>&gt;&gt;&gt; b = [8,6,3,3,2,7]</div>  <div>&gt;&gt;&gt; all(all(i&gt;j for j in b) for i in a)<BR>&gt;&gt;&gt; all(all(i&gt;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>&#32;

      <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>