def GCD(x, y): if x > y: small = y else: small = x for i in range(1, small + 1): if ((x % i == 0) and (y % i == 0)): gcd = i return gcd def LCM(x, y): if x > y: greater = x else: greater = y while(True): if((greater % x == 0) and (greater % y == 0)): lcm = greater break greater += 1 return lcm x=int(input('Please enter number1 :')) y=int(input('Please enter number2 :')) print('The least common multiple between '+ str(x) +' and '+ str(y) +' are: '+ str( LCM(x,y))) print('The greatest common divisor between ' + str(x) +' and '+ str(y) +' are: '+ str(GCD(x,y)))