iterate over all combinations of multiple lists in python
<p>Given multiple list of possibly varying length, I want to iterate over all combinations of selecting one item from each list. For example: </p>

<pre><code>first = [1, 5, 8]
second = [0.5, 4]
</code></pre>

<p>Then I want the output of to be:</p>

<pre><code>combined = [(1,0.5), (1,4), (5,0.4), (5,4), (8,0.5), (8,4)]
</code></pre>

<p>I want to iterate over the <em>combined</em> list. How do I get this done?</p>

<p>Thank you.</p>
