Python Matrix Multiplication

Here you will get program for python matrix multiplication.

If we want to multiple two matrices then it should satisfy one condition. We need to check this condition while implementing code without ignoring.

Amxn x Bpxq then n should be equal to p. Then only we can multiply matrices. Now we will see how to multiply two matrices using python nested list matrix representation.

Python Matrix Multiplication

Below is python program to multiply two matrices.

Output

Python Matrix Multiplication


One thought on “Python Matrix Multiplication

  1. Senthil Selvan

    Hi. I am new to python and i don’t understand why you have used end=” ” in this line
    print(“\t”,matrix[i][j],end=” “)

    also i tried the same prgm and without the end ” ” [because i got an error saying that end is not declared] and my o/p is always printed 1 element per line and not in matrix format. So what should i do ??

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.