title: How to add elements to 3 dimensional array in python
body: <p>I am trying to store data in three-dimensional array i.e, <code>x[0][0][0]</code> in Python. How to initialize <code>x</code>, and add values to it? I have tried this:</p>
  
  <pre><code>x=[]
  x[0][0][0]=value1 
  x[0][0].append(value1)
  </code></pre>
  
  <p>both lines are giving out of range error. How to do it? I want it like: <code>x[0][0][0]=value1</code>, <code>x[1][0][0]=value2</code>, <code>x[0][1][0]=value3</code> etc. How to achieve this in Python? </p>
  
  <p>I am looking to generate this kind of array:</p>
  
  <pre><code>x=[[[11,[111],[112]],[12],[13]],[[21,[211],[212]],[22],[23],[24]],[[31],[32]]]
  x[0][0][0] will give 11
  x[1][0][0]  21
  x[0][0][1] 111
  </code></pre>
  
  <p>etc.</p>