Python Armstrong NumberPython Average of N NumbersPython Biggest of Three NumbersPython Common DivisorsPython Composite NumberPython Condense a NumberPython Even NumberPython Factorial of a NumberPython Fibonacci SeriesPython GCDPython LCMPython Leap YearPython Multiplication TablePython Number CombinationPython Odd NumberPython Palindrome NumberPython Perfect NumberPython Prime FactorPython Prime NumberPython Sum of DigitsPython Swapping Two Numbers

Python Array ProgramsPython Converter ProgramsPython Star Patterns ProgramPython Number Patterns ProgramPython Alphabet Patterns ProgramLast Updated:

A smallest common multiple of two or more integers.

In general, **Least Common Multiple** (LCM) is otherwise called as **Lowest Common Multiple** (LCM) or **Smallest Common Multiple** (SCM)

**Tips**: It is recommended to use our online LCM calculator for better understanding.

The following table provides few examples of LCM of the given numbers.

Numbers | LCM |
---|---|

4, 10 | 20 |

6, 5 | 30 |

15, 30 , 45 | 90 |

n the following example, we will find the LCM of the given two numbers (45, 90).

Python Compiler

num1 = 45
num2 = 90
max = (num1 > num2) and num1 or num2
while(1):
if((max % num1 == 0) and (max % num2 == 0)):
print("LCM of %d and %d: %d" % (num1, num2, max));
break
max += 1

In the following example, we will find the LCM of any two given numbers.

Python Compiler

num1 = int(input("Enter (int) num1 = "))
num2 = int(input("Enter (int) num2 = "))
max = (num1 > num2) and num1 or num2
while(1):
if((max % num1 == 0) and (max % num2 == 0)):
print("\nLCM of %d and %d: %d" % (num1, num2, max));
break
max += 1