mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 06:25:23 +01:00
12 lines
269 B
Python
12 lines
269 B
Python
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
|