title: Creating a list of pairs using comprehensions
body: <p>I'm trying to create a list of pairs, <code>p</code>, from 2 ranges,</p>
  
  <pre><code>r1 = [i for i in range(0, 10, 2)]
  r2 = [j for j in range(10, 0,-2)]
  </code></pre>
  
  <p>Such that,</p>
  
  <pre><code>p[0] = [r1[0], r2[1]]
  p[1] = [r1[1], r2[1]]
  .....
  p[-1] = [r1[-1], r2[-1]]
  </code></pre>
  
  <p>Naively I thought,</p>
  
  <pre><code>p = [[i, j] for i in range(0, 10, 2) for j in range(10, 0, -2)]
  </code></pre>
  
  <p>would do this but I soon saw the error of my ways.</p>
  
  <p>I also tried,</p>
  
  <pre><code>p = [r1[:], r2[:]]
  </code></pre>
  
  <p>but yeah that didn't work either.</p>
  
  <p>Then I tried,</p>
  
  <pre><code>p = []
  for i, j  in zip(r1, r2):
      p.append([i, j]) 
  </code></pre>
  
  <p>Which does work!</p>
  
  <p>But that got me wondering, is there a Pythonic way of doing this using list comprehensions?</p>
  
  <p>The 2 ranges will always be the same length in implementation but not always spanning the same domain.</p>
  
  <p>EDIT: to be clear I was wondering if it was possible to generate the ranges <code>r1</code> &amp; <code>r2</code> within the comprehension as well as the comprehension giving the pairing.</p>