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

16 lines
254 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