VOOZH about

URL: https://www.geeksforgeeks.org/python/python-sympy-factor-method/

⇱ Python | sympy.factor() method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Python | sympy.factor() method

Last Updated : 12 Jun, 2019
With the help of sympy.factor() method, we can find the factors of mathematical expressions in the form of variables by using sympy.factor() method.
Syntax : sympy.factor(expression) Return : Return factor of mathematical expression.
Example #1 : In this example we can see that by using sympy.factor() method, we can find the factors of mathematical expression with variables. Here we use symbols() method also to declare a variable as symbol. Output :
(x + y)**2
Example #2 :
Output :
(x + y + z)**2
Comment
Article Tags:
Article Tags: