code for finding the determinant of 2x2 matrix

 input("Enter the Matrix of 2x2 order only.")

a1=int(input("Enter R11:"))
a2=int(input("Enter R12: "))
a3=int(input("Enter R21: "))
a4=int(input("Enter R22: "))
b=(a1*a4)-(a3*a2)

if a1==int(a1):
    print("The determinant of the given matrix is:",b)
elif a2==int(a2):
 print("The determinant of the given matrix is:",b)
elif a3==int(a3):
     print("The determinant of the given matrix is:",b)
elif a4==int(a4):
  print("The determinant of the given matrix is:",b)
else:
  print("Enter only numeric value.")

Comments

Popular posts from this blog

Maths Unit 1 ( Theory )

Intelligence System notes part 2

code for find the determinant of 3x3 matrix