Nested Loops all
<p>I am using python. The assignment is simple, I understand the concept, I have zero knowledge of computer programming, so be gentle and please try to explain everything in much detail as if I know nothing, I am trying my best to learn. This is to show that with all combinations ijk, ikj, jik, jki, kij, and kji return the same result. The next step is to do the same thing with 4000. (try to figure how to put 4000 in matrix, shoot myself.) 
I know there are things like numpy but I have no idea how to use that, but I was going to try and start with the basics, straight from windows terminal. I would like to thank you for your time and help here guys! thanks!!!enter code here</p>

<pre><code>enter code here

    X = [[1,2,3,4,5],
        [6,7,8,9,10]]



    Y = [[1,2],
        [3,4],
        [5,6],
        [7,8],
        [9,10]]



    result = [[0,0],
             [0,0]]
     empty = [[0,0],
             [0,0]]

        for i in range(len(X)):
             for j in range(len(Y[0])):
                  for k in range(len(Y)):
                        result[i][j] += X[i][k] * Y[k][j]
for r in result:
    print r
    result = empty
    del r[:]


print""

for i in range(len(X)):
    for k in range(len(Y)):
        for j in range(len(Y[0])):
            result[i][j] += X[i][k] * Y[k][j]

for r in result:
    print r
    del r[:]


print""

for i in range(len(X)):
    for k in range(len(Y)):
        for j in range(len(Y[0])):
           result[i][j] += X[i][k] * Y[k][j]

for r in result:
    print r
    result = empty
    del r[:]
    del range[:]

print""

for j in range(len(Y[0])):    
    for i in range(len(X)):
        for k in range(len(Y)):
            result[i][j] += X[i][k] * Y[k][j]

for r in result:
    print r
    result = empty
    del r[:]

for j in range(len(Y[0])):
    for k in range(len(Y)):
        for i in range(len(X)):
            result[i][j] += X[i][k] * Y[k][j]

for r in result:
    print r
    result = empty
    del r[:]

for k in range(len(Y)):
    for i in range(len(X)):
        for j in range(len(Y[0])):
            result[i][j] += X[i][k] * Y[k][j]

 for r in result:
    print r
    result = empty
    del r[:]

for k in range(len(Y)):
    for j in range(len(Y[0])):
        for i in range(len(X)):
            result[i][j] += X[i][k] * Y[k][j]

for r in result:
    print r
    result = empty
    del r[:]
</code></pre>

<p>The problem, is the index, when running the code for the 3rd set, there is a  problem with the index, I can't figure that out.</p>

<pre><code>          result[i][j] += X[i][k] * Y[k][j]
        IndexError: list index out of range
</code></pre>

<pre><code>for i in range(len(X)):
    for k in range(len(Y)):
        for j in range(len(Y[0])):
           result[i][j] += X[i][k] * Y[k][j]
</code></pre>

<p><code>result[i][j]</code> is a <code>2x2</code> matrix <code>len(X)</code> and <code>len(Y)</code> are both <code>2</code>. Meanwhile <code>k</code> is going all the way up to <code>5</code>. This is what gives you your <code>list index out of range</code> error</p>

<p>You have to make your matrix sizes match up. </p>

python loops matrix indexing nested