mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 06:25:23 +01:00
lint fixes
This commit is contained in:
@@ -6,7 +6,7 @@ def complexDivisionFunc(maxRes=99, maxDivid=99, style='raw'):
|
|||||||
b = random.randint(1, min(maxRes, maxDivid))
|
b = random.randint(1, min(maxRes, maxDivid))
|
||||||
c = a / b
|
c = a / b
|
||||||
c = round(c, 2)
|
c = round(c, 2)
|
||||||
|
|
||||||
if style == 'latex':
|
if style == 'latex':
|
||||||
problem = "\\(" + str(a) + "\\div" + str(b) + "=\\)"
|
problem = "\\(" + str(a) + "\\div" + str(b) + "=\\)"
|
||||||
solution = "\\(" + str(c) + "\\)"
|
solution = "\\(" + str(c) + "\\)"
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ def divideFractionsFunc(maxVal=10, style='raw'):
|
|||||||
tmp_d = b * c
|
tmp_d = b * c
|
||||||
|
|
||||||
gcd = calculate_gcd(tmp_n, tmp_d)
|
gcd = calculate_gcd(tmp_n, tmp_d)
|
||||||
sol_numerator = tmp_n//gcd
|
sol_numerator = tmp_n // gcd
|
||||||
sol_denominator = tmp_d//gcd
|
sol_denominator = tmp_d // gcd
|
||||||
x = f"{sol_numerator}/{sol_denominator}"
|
x = f"{sol_numerator}/{sol_denominator}"
|
||||||
|
|
||||||
if (tmp_d == 1 or tmp_d == gcd):
|
if (tmp_d == 1 or tmp_d == gcd):
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ def divisionToIntFunc(maxA=25, maxB=25, style='raw'):
|
|||||||
solution = "\\(" + str(quotient) + "\\)"
|
solution = "\\(" + str(quotient) + "\\)"
|
||||||
else:
|
else:
|
||||||
problem = f"{divisor}/{dividend}="
|
problem = f"{divisor}/{dividend}="
|
||||||
solution = str(quotient)
|
solution = str(quotient)
|
||||||
return problem, solution
|
return problem, solution
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ def multiplicationFunc(maxRes=99, maxMulti=99, style='raw'):
|
|||||||
c = a * b
|
c = a * b
|
||||||
|
|
||||||
if style == 'latex':
|
if style == 'latex':
|
||||||
problem = "\\(" + str(a) + "\cdot" + str(b) + "=\\)"
|
problem = "\\(" + str(a) + "\\cdot" + str(b) + "=\\)"
|
||||||
solution = "\\(" + str(c) + "\\)"
|
solution = "\\(" + str(c) + "\\)"
|
||||||
else:
|
else:
|
||||||
problem = str(a) + "*" + str(b) + "="
|
problem = str(a) + "*" + str(b) + "="
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ from .__init__ import *
|
|||||||
def squareFunc(maxSquareNum=20, style='raw'):
|
def squareFunc(maxSquareNum=20, style='raw'):
|
||||||
a = random.randint(1, maxSquareNum)
|
a = random.randint(1, maxSquareNum)
|
||||||
b = a * a
|
b = a * a
|
||||||
|
|
||||||
if style == 'latex':
|
if style == 'latex':
|
||||||
problem = "\\(" + str(a) + "^{2}=\\)"
|
problem = "\\(" + str(a) + "^{2}=\\)"
|
||||||
solution = "\\(" + str(b) + "\\)"
|
solution = "\\(" + str(b) + "\\)"
|
||||||
|
|||||||
Reference in New Issue
Block a user