title: how to get a list of the possible pairs in a list of lists - python
body: <p>I have the following list of lists</p>
  
  <pre><code>a = [[1,2,3],[4,5,6,7]]
  </code></pre>
  
  <p>trying to get the following result</p>
  
  <pre><code>b = [[1,2],[1,3],[2,3],[4,5],[4,6],[4,7],[5,6],[5,7],[6,7]]
  </code></pre>
  
  <p>I have tried to use </p>
  
  <pre><code>b = list(itertools.product(a))
  </code></pre>
  
  <p>but I got a combination of the first with the second. Appreciate any help thanks</p>