With the help of
sympy.as_terms() method, we can get the mathematical expression as a list of terms by using
Return : Return list of terms that are in mathematical expression.
Example #1 :
In this example we can see that by using
sympy.as_terms() method, we are able to get the terms of mathematical expression in a list.
([(x**2, ((1.0, 0.0), (2, 0), ())), (y**2, ((1.0, 0.0), (0, 2), ())), (2*x*y, ((2.0, 0.0), (1, 1), ()))], [x, y])
Example #2 :
([(x, ((1.0, 0.0), (1, 0), ())), (y, ((1.0, 0.0), (0, 1), ()))], [x, y])
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