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.
from sympy import *
gfg = ilcm( 2 , 3 )
print (gfg)
|
Output :
6
Example #2 :
from sympy import *
gfg = ilcm( 7 , 6 )
print (gfg)
|
Output :
42
Last Updated :
02 Aug, 2019
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...