Home >>Python math Module >Python math.gamma() Method

Python math.gamma() Method

Python math.gamma() Method

Python math.gamma() method in python is an inbuilt method and is used to the numerically computes the gamma value (factorial(x-1)) of the given argument.

Syntax:
math.gamma(x)

Parameter Values

Parameter Description
x It is required a number to find the gamma value
Here is an example of Python math.gamma() Method:

import math
print (math.gamma(2))
print (math.gamma(-7.8))

Output:
1.0
0.0002029156958793608
Example 2:

import math 
gamma_var = 8
print ("The gamma value of the given argument is : "
					+ str(math.gamma(gamma_var)))

Output:
The gamma value of the given argument is : 5040.0

No Sidebar ads