title: Python `for` syntax: block code vs single line generator expressions
body: <p>I'm familiar with the <code>for</code> loop in a block-code context. eg:</p>
  
  <pre><code>for c in "word":
      print c
  </code></pre>
  
  <p>I just came across some examples that use <code>for</code> differently. Rather than beginning with the <code>for</code> statement, they tag it at the end of an expression (and don't involve an indented code-block). eg:</p>
  
  <pre><code>sum(x*x for x in range(10))
  </code></pre>
  
  <p>Can anyone point me to some documentation that outlines this use of <code>for</code>? I've been able to find examples, but not explanations. All the <code>for</code> documentation I've been able to find describes the previous use (block-code example). I'm not even sure what to call this use, so I apologize if my question's title is unclear.</p>