title: compactly generate list of list python
body: <p>I have to create a list of lists (each inner list has <code>n</code> fixed elements). Right now, for <code>n=3</code> I am doing this:</p>
  
  <pre><code>my_list = []
  for x in range(min_inner max_inner + 1):
      for y in range(min_outer, max_outer + 1):
          for z in range(fixed_param):
              my_list.append([x, y, z])
  </code></pre>
  
  <p>When I tried list comprehension, something like:</p>
  
  <p><code>[[x,y,z] for x in range(1,4), y in range(1,4), z in range (4)]</code></p>
  
  <p>I get a name error</p>
  
  <p><code>NameError: name 'z' is not defined</code></p>
  
  <p>Is there a list comprehension way of doing that? Considering that <code>n</code> can be any number (though not necessarily arbitrarily large)</p>