Open this example in the interactive library
Source code
from math import lcm
print(lcm(12, 18))Sample output
36

Compute least common multiple. A self-contained example using the Python standard library.
Open this example in the interactive library
from math import lcm
print(lcm(12, 18))36