Write a python function that takes in two numbers and returns their LCM
Topic: Write a python function that takes in two numbers and returns their LCM
Solution
def lcm(num1, num2): bigger = num1 if num1 > num2 else num2 while True: if (bigger % num1 == 0) and (bigger % num2 == 0): break bigger += 1 return bigger
List all Python Programs