title: multi variable for loops python
body: <p>I'm trying to understand what is happening in this piece of code. I can see what it does, but the process for how it gets there eludes me.</p>
  
  <pre><code>from itertools import groupby
  lines = '''
  This is the
  first paragraph.
  
  This is the second.
  '''.splitlines()
  # Use itertools.groupby and bool to return groups of
  # consecutive lines that either have content or don't.
  for has_chars, frags in groupby(lines, bool):
      if has_chars:
          print ' '.join(frags)
  # PRINTS:
  # This is the first paragraph.
  # This is the second.
  </code></pre>
  
  <p>I think my confusion surrounds the multiple variables in the for loop (in this instance <code>has_chars</code> and <code>frags</code>). How are multiple variables possible? What is happening? How is python dealing with multiple variables? What am I saying to python when I put multiple variables in a for loop? Is there a limit to how many variables you can create in a for loop? How can I ask a precise question when I don't understand enough about programming to actually form one?</p>
  
  <p>I've tried running it through the python visualiser to get a better understanding. That thing has never made anything clearer for me. Try as I oft do.</p>