Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

find sum of all elements in a matrix by python

x = [
    [1, 2, 3],
    [4, 5, 6],
    [7, 8, 9]
]

y = [
    [1, 2, 3],
    [4, 5, 6],
    [7, 8, 9]
]


for i in range(3):
    for j in range(3):
        print(x[i][j] + y[i][j])
 
PREVIOUS NEXT
Tagged: #find #sum #elements #matrix #python
ADD COMMENT
Topic
Name
5+4 =