Question: Q5: Write a function called elem_square that takes a 2D array matrix and returns a 2D array where every element in this 2D array is

 Q5: Write a function called elem_square that takes a 2D array

Q5: Write a function called elem_square that takes a 2D array matrix and returns a 2D array where every element in this 2D array is a square of corresponding element in matrix. def elem_square (matrix): Takes a matrix and square every element in the matrix and return it m0[[1,2], [3, 411 m1 [[10, 0, 01, [5, 2, 2], [0, 3, 4]1 m2 I1, 11, 12, 21, 16, 611 >elem_square(m0) >>>elem_square (m1) [[100, 0, 0], [25, 4, 4], [0, 9, 16]1 >elem_square(m2) [I1, 1], 14, 4], [36, 36]11 # YOUR CODE HERE

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!