mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 14:35:23 +01:00
restructure base
This commit is contained in:
11
mathgenerator/funcs/hcfFunc.py
Normal file
11
mathgenerator/funcs/hcfFunc.py
Normal file
@@ -0,0 +1,11 @@
|
||||
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
|
||||
Reference in New Issue
Block a user