Files
mathgenerator/mathgenerator/funcs/hcfFunc.py
2020-10-19 13:54:31 -04:00

13 lines
262 B
Python

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