get row and column of matrix
<p>I wonder where how to get row and column of this matrix. I want to loop through each element[row][column], but I have no idea how to get these.</p>

<pre><code>imaginary_axis = 100
real_axis = 1

mixed_matrix = [[0 for j in xrange(imaginary_axis)] for i in xrange(real_axis)]

for row in mixed_matrix[0]:
    print(row)
    for column in mixed_matrix:
         print(column)
         check(mixed_matrix[row][column])
</code></pre>

<p>This throws an error. How can I get this to work?</p>

<pre class="lang-none prettyprint-override"><code>TypeError: list indices must be integers, not list
</code></pre>

<p>I know why I get this error, but I do not know how I can get the column right.</p>

<p>I think, that you can use smth like <a href="https://docs.python.org/3/library/functions.html#enumerate" rel="nofollow">enumerate()</a></p>

<p>Cause in your example your <code>column</code> is a list, but as i can see - you want the number of element in this list.</p>

<p>I edit my answer:</p>

<p>What do you want? Magic? There is no magic. You have matrix, like this:
[[1, 2, 3]]</p>

<p>There is a list inside list. 
You want to iterate by elements?</p>

<p><code>for lst in matrix:
      for element in lst:
              print(element)</code></p>

<p>Or you can zip your lists in ONE list and iterate by element in that list.</p>

<p>If you want access by index - you should use it.
You should have two loops, the number of your lists is the number of rows, the number of your elements in list - is number of columns.</p>

<p>And you need smth lile:</p>

<pre><code>for row in range(0, len(mixed_matrix)):
   # mixed_matrix[row] - is your FIRST list
   for column in range(0, len(mixed_matrix[row])):
    print(mixed_matrix[row][column])
</code></pre>

python