title: IndexError: list index out of range in a loop
body: <p>I have a 3D array. I want extract the 3rd element. For example, here I want to print 6, 9, 20. But Python is throwing this error.</p>
  <pre><code>values = [
      [[0, 6], [0, 9], [0, 20]],
      [[1, 2], [1, 4], [1, 9 ]]]
  i=0
  for j in range(0,len(values[i])):
     print(values[i][i][j])
  </code></pre>
  <p>Not sure where this is going wrong because print(values[0][0][1]) works fine and gives 6 as it should</p>