# Python – lgamma() Function – Examples & Explanation

`lgamma()` function is used to find the natural logarithm of an absolute value of a gamma function at x, where x is the input value we pass as an argument to the `lgamma()` function. We can find gamma function by using `math.gamma()`. `lgamma()` function is a part of python programming language and it is a new function its available with the python `3.2` and above.

## Syntax of `lgamma()` Function

The syntax of `lgamma()` function in Python is:

```math.lgamma(x)
```

## Parameters of `lgamma()` Function in Python

`x` – Where `x` is a gamma function absolute value which we want to find the natural logarithm. This parameter is required.
Note: If the `x` parameter is not a number, `lgamma()` function will return an ```Error. ```

## Compatibility

`lgamma()` function is available and compatible with python `3.2` and above versions. This function is a part of python standard math library.

## Return Value of `lgamma()` Function in Python

`lgamma()` function returns the natural logarithm of the absolute value of the Gamma function for the given input (x – parameter).

## Python `lgamma()` Function Example

```# import math library
import math
print(math.lgamma(-0.2))
print(math.lgamma(1))
print(math.lgamma(0.2))
print(math.lgamma(77))
print(math.lgamma(2))
```

Output:
```1.761497590833938 0.0 1.5240638224307843 256.22113555000954 0.0```