Open In App

Python | sympy.Mul() method

Improve
Improve
Like Article
Like
Save
Share
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.




# 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


Last Updated : 11 Jul, 2019
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads