mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 06:25:23 +01:00
19 lines
505 B
Python
19 lines
505 B
Python
from .__init__ import *
|
|
from ..__init__ import Generator
|
|
|
|
|
|
def permutationFunc(maxlength=20):
|
|
a = random.randint(10, maxlength)
|
|
b = random.randint(0, 9)
|
|
|
|
solution = int(math.factorial(a) / (math.factorial(a - b)))
|
|
problem = "Number of Permutations from {} objects picked {} at a time = ".format(
|
|
a, b)
|
|
return problem, solution
|
|
|
|
|
|
permutations = Generator(
|
|
"Permutations", 42,
|
|
"Total permutations of 4 objects at a time from 10 objects is", "5040",
|
|
permutationFunc)
|