Related Articles

# Python | sympy.det() method

• Last Updated : 29 Jun, 2019

With the help of sympy.det() method, we can find the determinant of a matrix by using sympy.det() method.

Syntax : sympy.det()
Return : Return determinant of a matrix.

Example #1 :
In this example, we can see that by using sympy.det() method, we are able to find the determinant of a matrix.

 # import sympyfrom sympy import *  # Use sympy.det() methodmat = Matrix([[1, 0, 1], [2, -1, 3], [4, 3, 2]])d = mat.det()   print(d)

Output :

-1

Example #2 :

 # import sympyfrom sympy import *  # Use sympy.det() methodmat = Matrix([[1, 5, 1], [12, -1, 31], [4, 33, 2]])d = mat.det()   print(d)

Output :

-125

Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course

My Personal Notes arrow_drop_up