title: Python iterate over array of arrays special way
body: <p>I have this array of arrays:</p>
  
  <p><code>[[[1111, 2222, 3333], [4444, 5555, 6666]], [[7777]], [[8888, 9999]], [[0000]], [[1122, 2233]]]</code></p>
  
  <p>I need to get all the possible combinations IN ORDER of the elements of the list. </p>
  
  <p>Expected output for this example:</p>
  
  <ul>
  <li><code>[1111,2222,3333,7777,8888,9999,0000,1122,2233]</code></li>
  <li><code>[4444, 5555, 6666,7777,8888,9999,0000,1122,2233]</code></li>
  </ul>
  
  <p>As you may see in this example the first array of the array is the only one who has two options. </p>
  
  <p>I've tried with something like:</p>
  
  <pre><code>for i in array_input:
          for j in i:           
              print ', '.join([str(x) for x in j]),
  </code></pre>
  
  <p>but that is not getting me the expected output because is firstly iterating through the two array[0] options instead of picking one of them and filling the rest and then picking the other one and filling it.</p>
  
  <p>So I want some loop that gets <code>array[0][0],array[1][0],array[2][0]</code>... instead of: <code>array[0][0],array[0][1],array[1][0]</code>...</p>
  
  <p>thank you</p>