python calculate factorial

44

python factorial -

def factorial(n):
    fact = 1
    for num in range(2, n + 1):
        fact *= num
    return fact

Comments

Submit
0 Comments