Python | sympy.gamma() method
With the help of sympy.gamma() method, we can find the gamma function in SymPy. gamma(z) represents
which for positive integer z is the same as
.
Syntax: gamma(Z)
Parameters:
Z – It is the input value to the gamma function.
Returns: Returns the gamma function result of the input value.
Example #1:
# import sympy from sympy import * Z = 5print("Z = {}".format(Z)) # Use sympy.gamma() method gamma_Z = gamma(Z) print("gamma(Z) : {}".format(gamma_Z)) |
chevron_right
filter_none
Output:
Z = 5 gamma(Z) : 24
Example #2:
# import sympy from sympy import * X = symbols('x') print("X = {}".format(X)) # Use sympy.gamma() method gamma_X = gamma(X) print("gamma(X) : {}".format(gamma_X)) |
chevron_right
filter_none
Output:
X = x gamma(X) : gamma(x)
Recommended Posts:
- class method vs static method in Python
- Python | os.dup() method
- Python | set() method
- Python | next() method
- Python | os.waitid() method
- Python | shutil.which() method
- Python PIL | getpalette() Method
- Python PIL | getcolors() Method
- Python | os.WIFEXITED() method
- Python | Tensorflow cos() method
- Python | os.major() method
- Python | os.stat() method
- Python | os.minor() method
- Python | os.fstat() method
- Python | os.umask() method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



