mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 14:35:23 +01:00
complete restructure of the project. minor tweaks
This commit is contained in:
15
mathgenerator/funcs/factorialFunc.py
Normal file
15
mathgenerator/funcs/factorialFunc.py
Normal file
@@ -0,0 +1,15 @@
|
||||
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
|
||||
Reference in New Issue
Block a user