title: Python 2.7 creating a multidimensional list
body: <p>In Python I want an intuitive way to create a 3 dimensional list.</p>
  
  <p>I want an (n by n) list.  So for n = 4 it should be:</p>
  
  <pre><code>x = [[[],[],[],[]],[[],[],[],[]],[[],[],[],[]],[[],[],[],[]]]
  </code></pre>
  
  <p>I've tried using:</p>
  
  <pre><code>y = [n*[n*[]]]    
  y = [[[]]* n for i in range(n)]
  </code></pre>
  
  <p>Which both appear to be creating copies of a reference.
  I've also tried naive application of the list builder with little success:</p>
  
  <pre><code>y = [[[]* n for i in range(n)]* n for i in range(n)]
  y = [[[]* n for i in range(1)]* n for i in range(n)]
  </code></pre>
  
  <p>I've also tried building up the array iteratively using loops, with no success.  I also tried this:</p>
  
  <pre><code>y = []
  for i in range(0,n):
      y.append([[]*n for i in range(n)])
  </code></pre>
  
  <p>Is there an easier or more intuitive way of doing this?</p>