Smart syntax for this issue
<p>I have list of lists. Let say somethink like that:</p>

<pre><code>somelist = [ 
               [1, 2, 3],
               [4, 8, 2],
               [7, 8, 4, 8, 2],
           ]
</code></pre>

<p>Here my list contains 3 lists. With list which have <code>len(list) == 3</code> I want to do something like this:</p>

<pre><code>list1 = somelist[0]
list2 = somelist[1]
list3 = somelist[2]

for l1 in list1:
    for l2 in list2:
        for l3 in list3:
            function(something=[l1, l2, l3])
</code></pre>

<p>But my list can have <code>2 &lt;= len(somelist) &lt;= 10</code>. So if my list have <code>len(somelist) == 4</code> I have to do:</p>

<pre><code>list1 = somelist[0]
list2 = somelist[1]
list3 = somelist[2]
list4 = somelist[3]

for l1 in list1:
    for l2 in list2:
        for l3 in list3:
            for l4 in list4:
                function(something=[l1, l2, l3, l4])
</code></pre>

<p>So my question is how to write nice code which will work with different <code>len(somelist)</code>?</p>
