title: How can I make a 3-dimensional array in python
body: <p>I have been writing a simple version of Conway's Life simulation in python.</p>
  
  <p>First I initialized a two dimensional array using the below code (which I probably learned on this site)</p>
  
  <pre><code>def makearray():
      for i in range(n):
          a.append(['x'] * m)
  </code></pre>
  
  <p>...and I access the cells in that array by storing, or checking the value of, <strong>a[2][5]</strong> or what have you.</p>
  
  <p>That has worked nicely. But now I realize I need to make a second array, identical to the first, which will store the results of the evaluation that I do on the first array. </p>
  
  <p>I know that I could just make a second array by repeating the exact same code but instead call the second array b instead of a.  BUT, it would be a cooler, cleaner way process things if I simply made this into a 3-dimensional array, and the new dimension that I introduce would only be two units "wide" ... it would just have 0 and 1.</p>
  
  <p>So, echoing the above, I'd like the end result to have my array so that I could check the value of a[1][2][5]  ... or a[0][2][5].</p>
  
  <p>But, can you give me tips on how I would do the initialization of that array? similar to the initializing loop I pasted above... but with the extra level? :)</p>
  
  <p>Giant thanks!</p>