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.
# import sympy from sympy import * x, y = symbols( 'x y' ) # Use sympy.Mul() method mul = Mul(x, y) print (mul) |
Output :
x*y
Example #2 :
# import sympy from sympy import * x, y = symbols( 'x y' ) # Use sympy.Mul() method mul = Mul(x, y) + Mul(x, x) print (mul) |
Output :
x**2 + x*y