{"id":24409,"date":"2021-10-14T09:46:16","date_gmt":"2021-10-14T04:16:16","guid":{"rendered":"https:\/\/python-programs.com\/?p=24409"},"modified":"2021-11-05T21:07:49","modified_gmt":"2021-11-05T15:37:49","slug":"python-program-for-gamma-function","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-for-gamma-function\/","title":{"rendered":"Python Program for gamma() Function"},"content":{"rendered":"

In the previous article, we have discussed Python Program for tanh() Function<\/a>
\ngamma() Function in Python:<\/strong><\/p>\n

The gamma function at a number is returned by the math.gamma() method.<\/p>\n

Tip:<\/strong> Use the math.lgamma() method to find the log gamma value of a number.<\/p>\n

Gamma Function’s Mathematical Formula:<\/strong><\/p>\n

Math.gamma(Number) = (Number \u2013 1)!<\/p>\n

Syntax:<\/strong><\/p>\n

math.gamma(x)<\/pre>\n

Parameters:<\/strong><\/p>\n

x:<\/strong> This is required. It is a number for which the gamma function must be found. If the number is a negative integer, a ValueError is returned. It throws a TypeError if it is not a number.<\/p>\n

Return Value:<\/strong><\/p>\n

Returns a float value that represents the gamma function at x.<\/p>\n