title: Special type of combination using itertools
body: <p>I am almost finished with a task someone gave me that at first involved easy use of the product() function from itertools. 
  However, the person asked that it should also do something a bit different like:</p>
  
  <p>li = </p>
  
  <p>[[1, 2, 3],<br>
  [4, 5, 6]]</p>
  
  <p>A regular product() would give something like: [1, 4], [1, 5], [1, 6], [2, 4], [2, 5], [2, 6], [3, 4] ...</p>
  
  <p>What it should do is:</p>
  
  <p>Do a regular product(), <strong>then</strong>, add the next item from the first element in the list and so on. A complete set of example would be:</p>
  
  <p>[[1, 4, 2]<br>
  [1, 4, 3],<br>
  [1, 5, 2],<br>
  [1, 5, 3],<br>
  [2, 4, 3],<br>
  [2, 5, 3],<br>
  [2, 6, 3]]</p>
  
  <p>How should I use itertools in this circumstance?</p>
  
  <p>EDIT:</p>
  
  <p>It might help if I explain the goal of the program:
  The user will enter, for example, a 5 row by 6 column list of numbers.<br>
  A normal product() will result in a 5-number combination. The person wants a 6-number combination. Where will this "6th" number come from? It would come from his choice of which row he wants. </p>