mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 14:35:23 +01:00
Merge pull request #42 from bottleInALightning/master
I added Division with the result being an integer, not a float
This commit is contained in:
@@ -148,6 +148,14 @@ def logFunc(maxBase=3, maxVal=8):
|
|||||||
solution = str(a)
|
solution = str(a)
|
||||||
return problem, solution
|
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
|
# || Class Instances
|
||||||
|
|
||||||
#Format is:
|
#Format is:
|
||||||
@@ -165,3 +173,4 @@ lcm = Generator("Lcm_generator", 11, "LCM of a and b = ", "c", lcmFunc)
|
|||||||
gcd = Generator("Gcd_generator", 12, "GCD of a and b = ", "c", gcdFunc)
|
gcd = Generator("Gcd_generator", 12, "GCD of a and b = ", "c", gcdFunc)
|
||||||
basicAlgebra = Generator("Basic_Algebra", 13, "ax + b = c", "d", basicAlgebraFunc)
|
basicAlgebra = Generator("Basic_Algebra", 13, "ax + b = c", "d", basicAlgebraFunc)
|
||||||
log = Generator("Logarithm", 13, "log2(8)", "3", logFunc)
|
log = Generator("Logarithm", 13, "log2(8)", "3", logFunc)
|
||||||
|
intdivision = Generator("Easy Divisio",14,"a/b=","c",divisionToIntFunc)
|
||||||
Reference in New Issue
Block a user