Python | sympy.Mul() method
Last Updated :
11 Jul, 2019
With the help of sympy.Mul()
method, we can multiply two variables and can form a mathematical expression.
Syntax : sympy.Mul()
Return : Return the product of two variables.
Example #1 :
In this example we can see that by using sympy.Mul()
method, we are able two multiply the two variables and we can also form mathematical expression.
from sympy import * x, y = symbols( 'x y' )
mul = Mul(x, y)
print (mul)
|
Output :
x*y
Example #2 :
from sympy import * x, y = symbols( 'x y' )
mul = Mul(x, y) + Mul(x, x)
print (mul)
|
Output :
x**2 + x*y
Share your thoughts in the comments
Please Login to comment...