+4 votes
in Programming Languages by (16.6k points)
What python function should I use to find the factorial of an integer?

1 Answer

0 votes
by (33.0k points)

The factorial() function of the math library can be used to compute the factorial of any integer.

The math module of NumPy also has the factorial() function.


>>> import numpy as np
>>> np.math.factorial(5)

>>> import math
>>> math.factorial(5)