title: TypeError: 'int' object is not subscriptable (python)
body: <p>I'm having problems making a matrix multiplication algorithm in python3. </p>
  
  <p>This is the code:</p>
  
  <pre><code>def matrixMult(m1, m2):
      result = [[0 for x in range(len(m1))] for x in range(len(m2[0]))]
      # Iterate through rows of m1.
      for i in range(len(m1)):
          # Iterate through columns of m2.
          for j in range(len(m2[0])):
              # Iterate through rows of m2.
              for k in range(len(m2)):
                  result[i][j] += m1[i][k] * m2[k][j]   # error occurs here.
  
      return result
  </code></pre>
  
  <p>Trying to call it on two random matrices like so:</p>
  
  <pre><code>m = [3, 4, 2]
  n = [[13, 9, 7, 15], [8, 7, 4, 6], [6, 4, 0, 3]]
  r = matrixMult(m, n)
  </code></pre>
  
  <p>This results in the <code>TypeError: 'int' object is not subscriptable</code> message.</p>
  
  <p>I added a <code>print(type())</code> for both the matrices declared above and they are of class <code>'list'</code>. Did the same for the classes used in the function prototype, class <code>'list'</code>. Hell, everything is of type <code>'list'</code>. I don't know what the <code>int object</code> is.</p>