Question: python 2. [1] A 2 x 2 matrix M is given as a list with two elements, each of which is one row in M.
![python 2. [1] A 2 x 2 matrix M is given](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f4555c005fc_66766f4555b87c76.jpg)

python
2. [1] A 2 x 2 matrix M is given as a list with two elements, each of which is one row in M. In other words, M=[[1,2], [3,4]] represents the matrix 1 2 3 4 Given a 2 x 2 matrix M, return its determinant. #Question 2 def det(M): A2 by 2 matrix M is given as a list with two elements, each of which is one row in M. Return its determinant. # insert your code here # test cases to try out print(det([[1,0], [0,1]])) # should print 1 print(det([[1,2],[3,4])) # should print -2 print(det([[7,12),(-4,-8]])) # should print - 8
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
