title: Comparing two lists using the greater than or less than operator
body: <p>I noticed a piece of code recently directly comparing two lists of integers like so:</p>
  
  <pre><code>a = [10,3,5, ...]
  b = [5,4,3, ...,]
  if a &gt; b:
       ...
  </code></pre>
  
  <p>which seemed a bit peculiar, but I imagined it would return <code>True</code> if all of <code>list_a</code>'s elements are larger then <code>list_b</code>'s and False if each element is equal or <code>list_b</code>'s elements are larger then <code>list_a</code>'s. So I tested it: </p>
  
  <pre><code>&gt;&gt;&gt; a=[3,3,3,3]
  &gt;&gt;&gt; b=[4,4,4,4]
  &gt;&gt;&gt; a&gt;b
  False
  &gt;&gt;&gt; b&gt;a
  True
  </code></pre>
  
  <p>Ok that works. As does: </p>
  
  <pre><code>&gt;&gt;&gt; b = [1,1,1,1]
  &gt;&gt;&gt; a = [1,1,1,1]
  &gt;&gt;&gt; a&gt;b
  False
  &gt;&gt;&gt; b&gt;a
  False
  </code></pre>
  
  <p>but when it gets more fuzzy:</p>
  
  <pre><code>&gt;&gt;&gt; a=[1,1,3,1]
  &gt;&gt;&gt; b=[1,3,1,1]
  &gt;&gt;&gt; a&gt;b
  False
  &gt;&gt;&gt; b&gt;a
  True
  </code></pre>
  
  <p>or: </p>
  
  <pre><code>&gt;&gt;&gt; a=[1,3,1,1]
  &gt;&gt;&gt; b=[1,1,3,3]
  &gt;&gt;&gt; a&gt;b
  True
  &gt;&gt;&gt; b&gt;a
  False
  </code></pre>
  
  <p>the results are a bit stranger. What is python actually doing? It seems that it's returning the result in favour of the first list in which the left most element is greater then the corresponding? </p>