Question: IN PYTHON def process_matrix(matrix): process a 2-D list Finish this function which accepts a 2-D(nested) list and calculate the sum of all the item

IN PYTHON def process_matrix(matrix): """ process a 2-D list Finish this function which accepts a 2-D(nested) list and calculate the sum of all the item in this 2-D matrix. For example, a 2-D matrix may look like [[1,3],[2,4]]. The first list [1, 3] is the first line and [2, 4] is the 2nd line: [ [1, 3], [2, 4] ] You can assume that there are multiple lines of this matrix and each line has multiple values. Hint: the input matrix may not be a n-by-n matrix. The return value should be the sum. Micro-credential(s): - Using loops (both for loops and while loops) to visit all the items in a list - Using indexes to access items in nested lists """
#======================================= my_2d_list = [[88,1], [5,67], [52,60,7]] print(process_matrix(my_2d_list)) # should b 280 print("--"*10) 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!