#Week 4 Homework Matrix Inverses #CB2240 S01 #Tse Tsz Wong #57153200 matrix=[] matrix=input('Enter a 2 by 2 matrix using the expression [[a,b],[c,d]]: ') a=float(matrix[2]) b=float(matrix[4]) c=float(matrix[8]) d=float(matrix[10]) det=((a*d)-(b*c)) inv_a=1/det inv_b=1/det inv_c=1/det inv_d=1/det inverse=[[d,-b],[-c,a]] print('The inverse of the matrix is:', inverse,'.\n')