Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management With Website Development Applications

Authors: Greg Riccardi

1st Edition

0201743876, 978-0201743876

More Books

Students also viewed these Databases questions

Question

mple 10. Determine d dx S 0 t dt.

Answered: 1 week ago