title: Matrix transpose without numpy, error: list index out of range
body: <p>I wanted to do the transpose of a matrix. I don't want to use numpy. I am getting the following error, (below code). Any help is appreciated</p>
  
  <pre><code>    matrix = [[1,2,3],[1,2,3],[1,2,3],[1,2,3],[1,2,3],[1,2,3],[1,2,3]]
  
      transposed = []
  
      for i in range(7):
          new=[]
          for row in matrix:
              new.append(row[i])
          transposed.append(lst)
      print(transposed)
  </code></pre>
  
  <p>error:</p>
  
  <pre><code>---------------------------------------------------------------------------
  IndexError                                Traceback (most recent call last)
  &lt;ipython-input-106-856d3ec27942&gt; in &lt;module&gt;()
        6     new=[]
        7     for row in matrix:
  ----&gt; 8         new.append(row[i])
        9     transposed.append(lst)
       10 print(transposed)
  
  IndexError: list index out of range
  </code></pre>