Files
mathgenerator/mathgenerator/funcs/factorialFunc.py
2020-10-19 19:33:00 +05:30

16 lines
266 B
Python

from .__init__ import *
def factorialFunc(maxInput=6):
a = random.randint(0, maxInput)
n = a
problem = str(a) + "! = "
b = 1
while a != 1 and n > 0:
b *= n
n -= 1
solution = str(b)
return problem, solution