title: Transpose a matrix in Python
body: <p>I'm trying to create a matrix transpose function in Python. A matrix is a two dimensional array, represented as a list of lists of integers. For example, the following is a 2X3 matrix (meaning the height of the matrix is 2 and the width is 3):</p>
  <pre><code>A=[[1, 2, 3],
     [4, 5, 6]]
  </code></pre>
  <p>To be transposed the jth item in the ith index should become the ith item in the jth index. Here's how the above sample would look transposed:</p>
  <pre><code>&gt;&gt;&gt; transpose([[1, 2, 3],
                 [4, 5, 6]])
  [[1, 4],
  [2, 5],
  [3, 6]]
  &gt;&gt;&gt; transpose([[1, 2],
                 [3, 4]])
  [[1, 3],
  [2, 4]]
  </code></pre>
  <p>How can I do this?</p>