Files
mathgenerator/mathgenerator/funcs/lcmFunc.py
2020-10-19 19:33:00 +05:30

18 lines
296 B
Python

from .__init__ import *
def lcmFunc(maxVal=20):
a = random.randint(1, maxVal)
b = random.randint(1, maxVal)
c = a * b
x, y = a, b
while y:
x, y = y, x % y
d = c // x
problem = f"LCM of {a} and {b} ="
solution = str(d)
return problem, solution