Files
mathgenerator/mathgenerator/funcs/squareRootFunc.py
2020-10-19 20:33:18 -04:00

15 lines
315 B
Python

from .__init__ import *
from ..__init__ import Generator
def squareRootFunc(minNo=1, maxNo=12):
b = random.randint(minNo, maxNo)
a = b * b
problem = "sqrt(" + str(a) + ")="
solution = str(b)
return problem, solution
squareRoot = Generator("Square Root", 6, "sqrt(a)=", "b", squareRootFunc)