Addition of two matrices in python with user input


 

Addition of two matrices in python

In [1]:
Enter the number of rows of first matrix: 2
Enter the number of cloumns of first matrix: 3
Enter the elements of the first matrix: 
3
4
5
4
5
6
First entered matrix is: 
3 4 5 
4 5 6 
Enter the number of rows of second matrix: 2
Enter the number of columns of second matrix: 3
Enter the elements of the second entered matrix: 
4
5
6
6
7
8
Second entered matrix is: 
4 5 6 
6 7 8 
Addition is possible.
Summation of the two given matrix is: 
7 9 11 
10 12 14 

1 comment: