Facebook Page Twitter Page LinkedIn Page
× Python Tutorial Python Advanced Python Resources Python Libraries


The Python math.gamma() function is used to return the gamma function of the argument.

Syntax

math.gamma(x)   

Parameters

x Required. Specify the value.

Return Value

Returns the gamma function of the argument.

Example:

The below example shows the usage of gamma() function.

import math

print(math.gamma(0.1))
print(math.gamma(1.5))
print(math.gamma(2.5))
print(math.gamma(-1.5))
print(math.gamma(-2.5))

The output of the above code will be:

9.513507698668732
0.886226925452758
1.3293403881791372
2.3632718012073544
-0.9453087204829417

❮ Python Math Module