title: How to iterate in a cartesian product of lists
body: <p>I would like to iterate in a for loop using 3 (or any number of) lists with any number of elements, for example:</p>
  
  <pre><code>from itertools import izip
  for x in izip(["AAA", "BBB", "CCC"], ["M", "Q", "S", "K", "B"], ["00:00", "01:00", "02:00", "03:00"]):
      print x
  </code></pre>
  
  <p>but it gives me:</p>
  
  <pre><code>('AAA', 'M', '00:00')
  ('BBB', 'Q', '01:00')
  ('CCC', 'S', '02:00')
  </code></pre>
  
  <p>I want:</p>
  
  <pre><code>('AAA', 'M', '00:00')
  ('AAA', 'M', '01:00')
  ('AAA', 'M', '02:00')
  .
  .
  
  ('CCC', 'B', '03:00')
  </code></pre>
  
  <p>Actually I want this:</p>
  
  <pre><code>for word, letter, hours in [cartesian product of 3 lists above]
      if myfunction(word,letter,hours):
         var_word_letter_hours += 1
  </code></pre>