Monday, December 22, 2025
HomeLanguagesPython | 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
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32455 POSTS0 COMMENTS
Milvus
111 POSTS0 COMMENTS
Nango Kala
6823 POSTS0 COMMENTS
Nicole Veronica
11958 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12038 POSTS0 COMMENTS
Shaida Kate Naidoo
6958 POSTS0 COMMENTS
Ted Musemwa
7203 POSTS0 COMMENTS
Thapelo Manthata
6911 POSTS0 COMMENTS
Umr Jansen
6890 POSTS0 COMMENTS