Files
mathgenerator/mathgenerator/funcs/moduloFunc.py
2020-10-19 13:54:31 -04:00

12 lines
279 B
Python

from .__init__ import *
def moduloFunc(maxRes=99, maxModulo=99):
a = random.randint(0, maxModulo)
b = random.randint(0, min(maxRes, maxModulo))
c = a % b if b != 0 else 0
problem = str(a) + "%" + str(b) + "="
solution = str(c)
return problem, solution