Open In App

Python | sympy.Mul() method

Last Updated : 11 Jul, 2019
Comments
Improve
Suggest changes
Like Article
Like
Report
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. Python3 1=1
# 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 : Python3 1=1
# 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

Article Tags :
Practice Tags :

Similar Reads