Saturday, November 16, 2024
Google search engine
HomeLanguagesPython | sympy.Mul() method

Python | sympy.Mul() method

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

Dominic Rubhabha-Wardslaus
Dominic Rubhabha-Wardslaushttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Recent Comments