GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing www.geeksforgeeks.org — Python | math.factorial() function - GeeksforGeeks Python | math.factorial() functionLast Updated : 16 Feb, 2023 In Python, math module contains a number of mathematical operations, which can be performed with ease using the module. math.factorial() function returns the factorial of desired number. Syntax: math.factorial(x) Parameter: x: This is a numeric expression. Returns: factorial of desired number. Time Complexity: O(n) where n is the input number. Auxiliary space: O(1) Code #1:
Output:
The factorial of 5 is : 120 Code #2:
Output: The factorial of 5 is : 120 The factorial of 15 is : 1307674368000 The factorial of 8 is : 40320 Code #3: Throws ValueError if x is not integer
Output: ValueError: factorial() only accepts integral values Comment Explore |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |