title: Doubt in Python FOR cycle
body: <p>I'm with some doubts in a Python FOR cycle:</p>
  
  <p>This code works great:</p>
  
  <pre><code>a, b, c, d, e, f, g, h = range(8)
  
  _ = float('inf')
  
     # a b c d e f g h
  W = [
      [0,2,1,3,9,4,_,_], # a
      [_,0,4,_,3,_,_,_], # b
      [_,_,0,8,_,_,_,_], # c
      [_,_,_,0,7,_,_,_], # d
      [_,_,_,_,0,5,_,_], # e
      [_,_,2,_,_,0,2,2], # f
      [_,_,_,_,_,1,0,6], # g
      [_,_,_,_,_,9,8,0]] # h
  
  sum(1 for w in W[a] if w &lt; _) - 1 # Degree
  </code></pre>
  
  <p>My question is:</p>
  
  <p>The the "FOR x IN y IF x &lt; 10" only works inside a SUM?</p>
  
  <p>I have tested this but it does not work:</p>
  
  <pre><code>a, b, c, d, e, f, g, h = range(8)
  
  _ = float('inf')
  
     # a b c d e f g h
  W = [
      [0,2,1,3,9,4,_,_], # a
      [_,0,4,_,3,_,_,_], # b
      [_,_,0,8,_,_,_,_], # c
      [_,_,_,0,7,_,_,_], # d
      [_,_,_,_,0,5,_,_], # e
      [_,_,2,_,_,0,2,2], # f
      [_,_,_,_,_,1,0,6], # g
      [_,_,_,_,_,9,8,0]] # h
  
  for w in W[a] if w &lt; _:
      print 1
  </code></pre>
  
  <p>Best Regards,</p>