title: How do I iterate through two lists in parallel?
body: <p>I have two iterables, and I want to go over them in pairs:</p>
  <pre class="lang-py prettyprint-override"><code>foo = [1, 2, 3]
  bar = [4, 5, 6]
  
  for (f, b) in iterate_together(foo, bar):
      print(&quot;f:&quot;, f, &quot; |  b:&quot;, b)
  </code></pre>
  <p>That should result in:</p>
  <pre class="lang-none prettyprint-override"><code>f: 1  |  b: 4
  f: 2  |  b: 5
  f: 3  |  b: 6
  </code></pre>
  <p><em>One</em> way to do it is to iterate over the indices:</p>
  <pre class="lang-py prettyprint-override"><code>for i in range(len(foo)):
      print(&quot;f:&quot;, foo[i], &quot; |  b:&quot;, bar[i])
  </code></pre>
  <p>But that seems somewhat unpythonic to me. Is there a better way to do it?</p>