Looping through a mutidimentional array in python
<p>How do i achieve line 9 and 10 i.e the two <code>for</code> loops in python </p>

<pre><code>matrix = [
    [1, 2, 3, 4],
    [5, 6, 7, 8],
    [9, 10, 11, 12]
]

newMatrix = []

for (i=0; i &lt; len(matrix); i++):
    for (j=0; j &lt; len(matrix[i]); j++):
        newMatrix[j][i] = matrix[i][j]
print newMatrix
</code></pre>

<p>PS: i know i can do <code>[[row[i] for row in matrix] for i in range(4)]</code> but how i do only using for loops</p>
