Subtraction of two matrices in python with user input


Subtraction of two matrices in python

In [1]:
Enter the number of rows of first matrix: 3
Enter the number of columns of first matrix: 3
Enter the number of rows of second matrix: 3
Enter the number of columns of second matrix: 3
Substaction is possible.
Enter the elemenets of the first matrix: 
20
30
40
30
40
50
40
50
60
Enter the elements of the second matrix: 
2
3
4
3
4
5
4
5
6
First matrix is: 
20 30 40 
30 40 50 
40 50 60 
Second matrix is: 
2 3 4 
3 4 5 
4 5 6 
Matrix after performing substraction from A to B: 
18 27 36 
27 36 45 
36 45 54 
In [ ]:

No comments:

Post a Comment