Matrix Addition in Python

Matrix Addition in Python

Here you will learn that how to do Matrix Addition in Python programming.

 

Matrix addition in Python refers to the operation of adding two matrices together element-wise. This means that the corresponding elements from each matrix are added together to form a new matrix with the same dimensions.

For exam.

Matrix1 = [[1, 2, 3],

                     [4, 5, 6],

                    [7, 8, 9]]

Matrix2 = [[1, 2, 3],

                      [4, 5, 6],

                      [7, 8, 9]]

Matrix_Sum = [[2, 4, 6],

                               [8, 10, 12],

                              [14, 16, 18]]

 

Program Code of Matrix Addition in Python

Output

[2, 4, 6]
[8, 10, 12]
[14, 16, 18]

 

 

Check out our other Python examples

 

 

 

Leave a Comment

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

Scroll to Top