title: Python will not append to list in for loop
body: <p>i am basically trying to switch around an array of arrays; my initial data are:</p>
  
  <pre><code>array = [
      [0,0,0],
      [1,1,1]
      ]
  </code></pre>
  
  <p>the output should be:</p>
  
  <pre><code>    [
      [0,1],
      [0,1],
      [0,1]
      ]
  </code></pre>
  
  <p>however what i get is:</p>
  
  <pre><code>[]
  </code></pre>
  
  <p>i have tried doing the same thing without the loops but when i introduce them it just wont append!</p>
  
  <p>see code here:</p>
  
  <pre><code>array = [
      [0,0,0],
      [1,1,1]
      ]
  transformedArray = []
  #add rows to transformed
  for j in range(0, len(array) - 1):
      transformedArray.append([])
  #for each row
  for i in range(0, len(array[0]) - 1):
      #for each column
      for k in range(0, len(array) - 1):
          transformedArray[i].append(array[k][i])
  </code></pre>
  
  <p>can you help? i have not found any similar issues online so i am guessing i've missed something stupid!</p>