Wednesday, July 3, 2024
HomeLanguagesPythonPython | sympy.ilcm() method

Python | sympy.ilcm() method

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

Syntax : sympy.ilcm(var1, var2)
Return : Return value of least common multiple of two nonnegative integers.

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




# import sympy
from sympy import *
  
# Using sympy.ilcm() method
gfg = ilcm(2, 3)
  
print(gfg)


Output :

6

Example #2 :




# import sympy
from sympy import *
  
# Using sympy.ilcm() method
gfg = ilcm(7, 6)
  
print(gfg)


Output :

42

Thapelo Manthata
I’m a desktop support specialist transitioning into a SharePoint developer role by day and Software Engineering student by night. My superpowers include customer service, coding, the Microsoft office 365 suite including SharePoint and power platform.
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments