The math.lgamma() function is used to calculate the natural logarithm of the absolute value of the Gamma function of a given argument. The lgamma part of the function name is the shortened form of log gamma.

Gamma function, in mathematics,  is an extension of the factorial function to all real numbers. It is defined by the expression: γ(x) = (x-1)!

math.lgamma(x

Parameter x must be a real number.

import math

print(math.lgamma(0.5))
print(math.lgamma(4))
print(math.lgamma(5))
print(math.lgamma(10))