Question: Consider the matrix M = 1 5 2 1 8 7 2 3 5 8 6 0 . ( a ) What is the outcome

Consider the matrix
M =
1521
8723
5860
.
(a) What is the outcome of the following code?
for column in M[2]:
print(column)
Enter the values in the order that they would be output, separated by commas.
(b) Look at the code below. In what order are the entries of the matrix added? (Enter the numbers corresponding to the matrix entries, in the correct order and separated by commas, in the answer field below.)
s=0
for i in range(0,len(M)):
for j in range(0,len(M[0])):
s+=M[i][j]
print(s)

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!