Posts

Showing posts with the label Python program to add two matrices

Python program to add two matrices

Image
Addition of two matrices in python Problem description : The program gets two matrices as input from the user and returns the sum of two matrices. For adding two matrices the input matrices should be of same order. Example,          1 2 3 A=    4 5 6           Order of A => 3x3          7 8 9          1 1 1 B=    2 2 2             Order of B => 3x3          3 3 3               2   3   4 A+B=   6   7   8               10 11 12 Whereas fo the matrices,            1 2 3 A=     4 5 6               Order of A => 3x3           7 8 9          1 2 ...