title: How do I iterate over the tuples of the items of two or more lists in Python?
body: <p>Specifically, I have two lists of strings that I'd like to combine into a string where each line is the next two strings from the lists, separated by spaces:</p>
  
  <pre><code>a = ['foo1', 'foo2', 'foo3']
  b = ['bar1', 'bar2', 'bar3']
  </code></pre>
  
  <p>I want a function combine_to_lines() that would return:</p>
  
  <pre><code>"""foo1 bar1
  foo2 bar2
  foo3 bar3"""
  </code></pre>
  
  <p>I admit I've already solved this problem, so I'm going to post the answer.  But perhaps someone else has a better one or sees a flaw in mine.</p>
  
  <p><strong>Update</strong>: I over-simplified my example above.  In my real-world problem the lines were formatted in a more complicated manner that required the tuples returned from zip() to be unpacked.  But kudos to <a href="https://stackoverflow.com/users/21945/mhawke">mhawke</a> for coming up to the simplest solution to this example.</p>