Horje
Python | sympy.lcm() method

With the help of sympy.lcm() method, we can find the least common multiple of two numbers that is passed as a parameter in the sympy.lcm() method.

Syntax : sympy.lcm(var1, var2)
Return : Return value of least common multiple.

Example #1 :
In this example we can see that by using sympy.lcm() method, we are able to find the least common multiple of any two numbers that is passed as parameters.




# import sympy
from sympy import *
  
# Using sympy.lcm() method
gfg = lcm(61, 24)
  
print(gfg)

Output :

1464

Example #2 :




# import sympy
from sympy import *
  
# Using sympy.lcm() method
gfg = lcm(17, 16)
  
print(gfg)

Output :

272




Reffered: https://www.geeksforgeeks.org


Python

Related
Python | sympy.Rational() method Python | sympy.Rational() method
pwd module in Python pwd module in Python
grp module in Python grp module in Python
Python | sympy.as_independent() method Python | sympy.as_independent() method
ToDo webapp using Django ToDo webapp using Django

Type:
Geek
Category:
Coding
Sub Category:
Tutorial
Uploaded by:
Admin
Views:
9