Multiplication of two matrices in python with user input


 

Multiplication of two matrices in python

In [1]:
Enter the number of rows of the first matrix: 2
Enter the number of columns of the first matrix: 3
Enter the number of rows of the second matrix: 3
Enter the number of columns of the second matrix: 4
Multiplication is possible: 
Enter the elements of the first matrix: 
2
3
4
3
4
5
Enter the elements of the second matrix: 
3
4
5
6
2
3
4
5
1
2
3
4
First matrix is: 
2 3 4 
3 4 5 
Second matrix is: 
3 4 5 6 
2 3 4 5 
1 2 3 4 
Multiplication of the two marix is: 
16 25 34 
22 34 46 

1 comment:

  1. Thank you very much!! I am searching this solution for a long time.

    ReplyDelete