mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 14:35:23 +01:00
renamed modules and generators to fit pep8
This commit is contained in:
14
mathgenerator/funcs/subtraction.py
Normal file
14
mathgenerator/funcs/subtraction.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from .__init__ import *
|
||||
|
||||
|
||||
def subtractionFunc(maxMinuend=99, maxDiff=99):
|
||||
a = random.randint(0, maxMinuend)
|
||||
b = random.randint(max(0, (a - maxDiff)), a)
|
||||
c = a - b
|
||||
|
||||
problem = str(a) + "-" + str(b) + "="
|
||||
solution = str(c)
|
||||
return problem, solution
|
||||
|
||||
|
||||
subtraction = Generator("Subtraction", 1, "a-b=", "c", subtractionFunc)
|
||||
Reference in New Issue
Block a user