diff --git a/mathgenerator/mathgen.py b/mathgenerator/mathgen.py index 0829dc7..96e9c47 100644 --- a/mathgenerator/mathgen.py +++ b/mathgenerator/mathgen.py @@ -35,9 +35,27 @@ def subtractionFunc(maxMinuend = 99, maxDiff = 99): solution = str(c) return problem, solution +def multiplicationFunc(maxRes = 99, maxMulti = 99): + a = random.randint(0, maxMulti) + b = random.randint(0, min(maxRes, maxMulti)) + c = a*b + problem = str(a) + "*" + str(b) + "=" + solution = str(c) + return problem, solution + +def divisionFunc(maxRes = 99, maxDivid = 99): + a = random.randint(0, maxDivid) + b = random.randint(0, min(maxRes, maxDivid)) + c = a/b + problem = str(a) + "/" + str(b) + "=" + solution = str(c) + return problem, solution # || Class Instances #Format is: #