title: Python structured looping over multiple items
body: <p>I would like to loop over three lists</p>
  
  <pre><code>['A','B'],[1,2],[3,4]
  </code></pre>
  
  <p>If I wanted to loop over all possibilities, I could have done this:</p>
  
  <pre><code>for i,j,k in zip(['A','B'],[1,2],[3,4])
  </code></pre>
  
  <p>However, I want to loop in a certain manner. I want to iterate over 
  <code>'A',1 and 'B',2</code> for all possible values of the last list. Thus I want to exclude the combinations</p>
  
  <pre><code> 'A',2 and 'B',1.
  </code></pre>
  
  <p>Basically I want to generate the following items.
  <code>'A',1,3 'A',1,4 'B',2,3 B',2,4</code></p>
  
  <p>I am clueless on how to do it.</p>