title: Python list of list of lists
body: <p>I don't have a real reason for doing this, other than to gain understanding, but I'm trying to create a list of lists of lists using list comprehension.</p>
  
  <p>I can create a list of lists just fine:</p>
  
  <pre><code>In[1]: [j for j in [range(3,k) for k in [k for k in range(5,10)]]]
  Out[1]: [[3, 4], [3, 4, 5], [3, 4, 5, 6], [3, 4, 5, 6, 7], [3, 4, 5, 6, 7, 8]]
  </code></pre>
  
  <p>And I can create a list of lists of lists from either the results of that, for example:</p>
  
  <pre><code>In [2]: [range(0,i) for i in [3,4]]
  Out[2]: [[0, 1, 2], [0, 1, 2, 3]]
  
  In [3]: [range(0,i) for i in j]
  Out[3]: 
  [[0, 1, 2],
   [0, 1, 2, 3],
   [0, 1, 2, 3, 4],
   [0, 1, 2, 3, 4, 5],
   [0, 1, 2, 3, 4, 5, 6],
   [0, 1, 2, 3, 4, 5, 6, 7]]
  </code></pre>
  
  <p>But when I try to combine it into a single statement it goes awry:</p>
  
  <pre><code>In [4]: [range(0,i) for i in [j for j in [range(3,k) for k in [k for k in range(5,10)]]]]
  ---------------------------------------------------------------------------
  TypeError: range() integer end argument expected, got list.
  </code></pre>
  
  <p>Am I missing some brackets somewhere?</p>