{"id":16219,"date":"2021-08-12T09:36:43","date_gmt":"2021-08-12T04:06:43","guid":{"rendered":"https:\/\/python-programs.com\/?p=16219"},"modified":"2021-11-22T18:38:27","modified_gmt":"2021-11-22T13:08:27","slug":"python-program-to-find-super-factorial-of-a-number","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-find-super-factorial-of-a-number\/","title":{"rendered":"Python Program to Find Super Factorial of a Number"},"content":{"rendered":"
In the previous article, we have discussed Python Program to Calculate the Value of nPr<\/a> Super factorial of a number is obtained by multiplying the first N factorials of a given Number.<\/p>\n Given a number, and the task is to find the superfactorial of an above-given number.<\/p>\n Examples:<\/strong><\/p>\n Example1:<\/strong><\/p>\n Input:<\/strong><\/p>\n Output:<\/strong><\/p>\n Example 2:<\/strong><\/p>\n Input:<\/strong><\/p>\n Output:<\/strong><\/p>\n Below are the ways to find SuperFactorial of a given Number.<\/p>\n Approach:<\/strong><\/p>\n Below is the implementation:<\/strong><\/p>\n Output:<\/strong><\/p>\n Approach:<\/strong><\/p>\n Below is the implementation:<\/strong><\/p>\n Output:<\/strong><\/p>\n Explore more instances related to python concepts from\u00a0Python Programming Examples<\/a>\u00a0Guide and get promoted from beginner to professional programmer level in Python Programming Language.<\/p>\n In the previous article, we have discussed Python Program to Calculate the Value of nPr Super factorial : Super factorial of a number is obtained by multiplying the first N factorials of a given Number. Given a number, and the task is to find the superfactorial of an above-given number. Examples: Example1: Input: Given Number …<\/p>\n
\nSuper factorial :<\/strong><\/p>\nGiven Number = 5<\/pre>\n
The super Factorial value of above given number = 34560<\/pre>\n
Given Number = 4<\/pre>\n
The super Factorial value of above given number = 288<\/pre>\n
Program to Find SuperFactorial of a Number.<\/h2>\n
\n
Method #1: Using For loop (Static Input)<\/h3>\n
\n
# Import math module using the import keyword.\r\nimport math\r\n# Give the number as static input and store it in a variable.\r\ngvn_numbr = 5\r\n# Take a variable and initialize it's value with '1'.\r\nsupr_factrl = 1\r\n# Loop from '1 ' to above given number using For loop.\r\nfor iteror in range(gvn_numbr+1):\r\n # Calculate the factorial of the iterator value using built-in factorial method\r\n # and multiply it with above initialized superfactorial value.\r\n # Store it in another variable.\r\n supr_factrl = supr_factrl * math.factorial(iteror)\r\n# Print the superfactorial value of the above given number.\r\nprint(\"The super Factorial value of above given number = \", supr_factrl)\r\n<\/pre>\n
The super Factorial value of above given number = 34560<\/pre>\n
Method #2: Using For Loop (User input)<\/h3>\n
\n
# Import math module using the import keyword.\r\nimport math\r\n# Give the number as User input and store it in a variable.\r\ngvn_numbr = int(input(\"Enter some Random Number =\"))\r\n# Take a variable and initialize it's value with '1'.\r\nsupr_factrl = 1\r\n# Loop from '1 ' to above given number using For loop.\r\nfor iteror in range(gvn_numbr+1):\r\n # Calculate the factorial of the iterator value using built-in factorial method\r\n # and multiply it with above initialized superfactorial value.\r\n # Store it in another variable.\r\n supr_factrl = supr_factrl * math.factorial(iteror)\r\n# Print the superfactorial value of the above given number.\r\nprint(\"The super Factorial value of above given number = \", supr_factrl)\r\n<\/pre>\n
Enter some Random Number = 4\r\nThe super Factorial value of above given number = 288<\/pre>\n
\n