Python program to print lcm of two numbers. The LCM numbers will be printed using the Python programming language. The simplest option for beginners is to use the Python language to solve multiple problems. The “smallest non-zero common number” that is a multiple of both numbers is the “least common multiple of two numbers”.

def compute_lcm(x, y):if x > y:bigger = xelse:bigger = ywhile(True):if((bigger % x == 0) and (bigger % y == 0)):lcm = biggerbreakbigger += 1return lcma = 30b = 20print("Result is", compute_lcm(a, b))