Here\'s my approach to factorials:
def factorial(n): \'\'\'Returns factorial of n\'\'\' r = 1 for i in range(1, n + 1): r *= i return
You can return the gamma function (math.gamma(x)), but it would probably be faster to generate the factorial with a for loop
math.gamma(x)