From bcffaa0f470af341385e495a182826878166c675 Mon Sep 17 00:00:00 2001 From: bottleInALightning Date: Thu, 15 Oct 2020 11:03:23 +0200 Subject: [PATCH] Added Easy Division --- mathgenerator/mathgen.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mathgenerator/mathgen.py b/mathgenerator/mathgen.py index 322f429..9884a29 100644 --- a/mathgenerator/mathgen.py +++ b/mathgenerator/mathgen.py @@ -148,6 +148,14 @@ def logFunc(maxBase=3, maxVal=8): solution = str(a) return problem, solution +def divisionToIntFunc(maxA=25, maxB=25): + a = random.randint(1,maxA) + b = random.randint(1,maxB) + divisor = a*b + dividend=random.choice([a,b]) + problem = f"{divisor}/{dividend} = " + solution=int(divisor/dividend) + return problem,solution # || Class Instances #Format is: