{"id":12147,"date":"2023-01-10T12:48:54","date_gmt":"2023-01-10T07:18:54","guid":{"rendered":"https:\/\/www.mygreatlearning.com\/blog\/factorial-program-in-python\/"},"modified":"2024-10-24T18:03:26","modified_gmt":"2024-10-24T12:33:26","slug":"factorial-program-in-python","status":"publish","type":"post","link":"https:\/\/www.mygreatlearning.com\/blog\/factorial-program-in-python\/","title":{"rendered":"Python Program to Find the Factorial of a Number"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"what-is-factorial\"><strong>What is Factorial?<\/strong><\/h2>\n\n\n\n<p>In simple words, <mark>if you want to find the factorial of a positive integer, keep multiplying it with all the positive integers less than that number. The final result that you get is the factorial of that number. So if you want to find the factorial of 7, multiply 7 with all positive integers less than 7, and those numbers would be 6,5,4,3,2,1. Multiply all these numbers by 7,<\/mark> and the final result is the factorial of 7.<\/p>\n\n\n\n<p><em>If you are looking to build your expertise in Python factorial program, consider getting certified. This <strong><a rel=\"noreferrer noopener\" href=\"https:\/\/www.mygreatlearning.com\/academy\/learn-for-free\/courses\/factorial-program-in-python\" target=\"_blank\">free course on Factorial Program in Python<\/a><\/strong> offers you complete guidance on the subject and also a certificate on completion which is sure to make your CV stand out. <\/em><gwmw style=\"display:none;\"><\/gwmw><\/p>\n\n\n\n    <div class=\"courses-cta-container\">\n        <div class=\"courses-cta-card\">\n            <div class=\"courses-cta-header\">\n                <div class=\"courses-learn-icon\"><\/div>\n                <span class=\"courses-learn-text\">Academy Pro<\/span>\n            <\/div>\n            <p class=\"courses-cta-title\">\n                <a href=\"https:\/\/www.mygreatlearning.com\/academy\/premium\/master-python-programming\" class=\"courses-cta-title-link\">Python Programming Course<\/a>\n            <\/p>\n            <p class=\"courses-cta-description\">In this course, you will learn the fundamentals of Python: from basic syntax to mastering data structures, loops, and functions. You will also explore OOP concepts and objects to build robust programs.<\/p>\n            <div class=\"courses-cta-stats\">\n                <div class=\"courses-stat-item\">\n                    <div class=\"courses-stat-icon courses-user-icon\"><\/div>\n                    <span>11.5 Hrs<\/span>\n                <\/div>\n                <div class=\"courses-stat-item\">\n                    <div class=\"courses-stat-icon courses-star-icon\"><\/div>\n                    <span>51 Coding Exercises<\/span>\n                <\/div>\n            <\/div>\n            <a href=\"https:\/\/www.mygreatlearning.com\/academy\/premium\/master-python-programming\" class=\"courses-cta-button\">\n                Start Free Trial\n                <div class=\"courses-arrow-icon\"><\/div>\n            <\/a>\n        <\/div>\n    <\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"formula-of-factorial\"><strong>Formula  of Factorial  <\/strong><\/h2>\n\n\n\n<p>Factorial of a number is denoted by n! is the product of all positive integers less than or equal to n:<br><mark>n! = n<em>*(n-1)*<\/em>(n-2)*<em>\u2026..<\/em>3*<em>2*<\/em>1<\/mark><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"10-factorial\">10 Factorial<gwmw style=\"display:none;\"><\/h2>\n\n\n\n<p>So what is 10!? Multiply 10 with all the positive integers which are less than 10. <br><mark>10! =10*<em>9<\/em>*8*<em>7<\/em>*6*<em>5<\/em>*4*<em>3<\/em>*2*1=3628800<\/mark><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"factorial-of-5\">Factorial of 5<\/h2>\n\n\n\n<p>To find '5!' again, do the same process. Multiply 5 with all the positive integers less than 5. Those numbers would be 4,3,2,1<br><mark>5!=5*<em>4<\/em>*3*<em>2*<\/em>1=120<\/mark><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"factorial-of-0\"><span style=\"text-decoration: underline;\">Factorial of 0<\/span><\/h2>\n\n\n\n<p>Since 0 is not a positive integer, as per convention, the factorial of 0 is defined to be itself.<br><mark>0!=1<\/mark><\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-10-factorial-for-blog.png\"><img decoding=\"async\" width=\"750\" height=\"811\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-10-factorial-for-blog.png\" alt=\"Factorial program in python\" class=\"wp-image-12233\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-10-factorial-for-blog.png 750w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-10-factorial-for-blog-277x300.png 277w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-10-factorial-for-blog-696x753.png 696w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-10-factorial-for-blog-388x420.png 388w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><figcaption class=\"wp-element-caption\">Factorial of a number<\/figcaption><\/figure>\n\n\n\n<p>Computing this is an interesting problem. Let us think about why simple multiplication would be problematic for a computer. The answer to this lies in how the solution is implemented. <gwmw style=\"display:none;\"><\/p>\n\n\n\n<p>1! = 1<br>2! = 2<br>5! = 120<br>10! = 3628800<br>20! = 2432902008176640000<br>30! = 9.332621544394418e+157<\/p>\n\n\n\n<p>The exponential rise in the values shows us that factorial is an exponential function, and the time taken to compute it would take exponential time. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"factorial-program-in-python\"><span style=\"text-decoration: underline;\"><strong>Factorial Program in Python<\/strong><\/span><\/h2>\n\n\n\n<p>We are going to go through 3 ways in which we can calculate factorial:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Using a function from the math module<\/li>\n\n\n\n<li>Iterative approach(Using for loop)<\/li>\n\n\n\n<li> Recursive approach<\/li>\n<\/ul>\n\n\n\n<div class=\"inherit-container-width wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\">\n<h3 class=\"wp-block-heading\" id=\"factorial-program-in-python-using-the-function\"><strong>Factorial program in Python using the function<\/strong><\/h3>\n\n\n\n<p> This is the most straightforward method which can be used to calculate the factorial of a number. Here we have a module named math which contains several mathematical operations that can be easily performed using the module. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import math\nnum=int(input(\"Enter the number: \"))\nprint(\"factorial of \",num,\" (function): \",end=\"\")\nprint(math.factorial(num))<\/code><\/pre>\n\n\n\n<p><strong><a href=\"https:\/\/onlinegdb.com\/rJeeu4pMv\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"TEST THE CODE (opens in a new tab)\">TEST THE CODE<\/a><\/strong><\/p>\n\n\n\n<p><mark>Input - Enter the number: 4<br>Output - Factorial of 4 (function):24 <\/mark><\/p>\n\n\n\n<h3 id=\"factorial-program-in-python-using-for-loop\"><strong>Factorial program in python using for loop<\/strong><\/h3>\n<\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>def iter_factorial(n):\n    factorial=1\n    n = input(\"Enter a number: \")\n    factorial = 1\n    if int(n) &gt;= 1:\n        for i in range (1,int(n)+1):\n            factorial = factorial * i\n        return factorial\n  \nnum=int(input(\"Enter the number: \"))\n\nprint(\"factorial of \",num,\" (iterative): \",end=\"\")\nprint(iter_factorial(num))<\/code><\/pre>\n\n\n\n<p><strong><a href=\"https:\/\/www.onlinegdb.com\/online_python_interpreter\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"TEST THE CODE (opens in a new tab)\">TEST THE CODE<\/a><\/strong><\/p>\n\n\n\n<p><mark>Input - Enter the number: 5<br>Output - Factorial of 5 (iterative) : 120 <\/mark><\/p>\n\n\n\n<p>Consider the iterative program. It takes a lot of time for the while loop to execute. The above program takes a lot of time, let's say infinite. The very purpose of calculating factorial is to get the result in time; hence, this approach does not work for huge<mark> numbers.<\/mark><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"factorial-program-in-python-using-recursion\"><strong>Factorial program in Python using recursion<\/strong><gwmw style=\"display:none;\"><\/gwmw><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>def recur_factorial(n):\n    \"\"\"Function to return the factorial\n    of a number using recursion\"\"\"\n    if n == 1:\n        return n\n    else:\n        return n*recur_factorial(n-1)\n\nnum=int(input(\"Enter the number: \"))\n\nprint(\"factorial of \",num,\" (recursive): \",end=\"\")\nprint(recur_factorial(num))<\/code><\/pre>\n\n\n\n<p><a href=\"https:\/\/www.onlinegdb.com\/online_python_interpreter\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\"><strong>TEST THE CODE<\/strong><\/a><\/p>\n\n\n\n<p><mark>Input -  Input - Enter the number : 4<br>Output - Factorial of 5 (recursive) : 24  <\/mark><\/p>\n\n\n\n<p>On a 16GB RAM computer, the above program could compute factorial values up to 2956. Beyond that, it exceeds the memory and thus fails. The time taken is less when compared to the iterative approach. But this comes at the cost of the space occupied.<\/p>\n\n\n\n<p>What is the solution to the above problem? <br>The problem of computing factorial has a highly repetitive structure. <\/p>\n\n\n\n<p>To compute factorial (4), we compute f(3) once, f(2) twice, and f(1) thrice; as the number increases, the repetitions increase. Hence, the solution would be to compute the value once and store it in an array from where it can be accessed the next time it is required. Therefore, we use dynamic programming in such cases. The conditions for implementing dynamic programming are<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><mark>Overlapping sub-problems<\/mark><\/li>\n\n\n\n<li><mark>optimal substructure<\/mark>&nbsp;<\/li>\n<\/ol>\n\n\n\n<p>Consider the modification to the above code as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def DPfact(N):\n    arr={}\n    if N in arr:\n        return arr&#091;N]\n    elif N == 0 or N == 1:\n        return 1\n        arr&#091;N] = 1\n    else:\n        factorial = N*DPfact(N - 1)\n        arr&#091;N] = factorial\n    return factorial\n    \nnum=int(input(\"Enter the number: \"))\n\nprint(\"factorial of \",num,\" (dynamic): \",end=\"\")\nprint(DPfact(num))<\/code><\/pre>\n\n\n\n<p><strong><a href=\"https:\/\/www.onlinegdb.com\/online_python_interpreter\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"TEST THE CODE (opens in a new tab)\">TEST THE CODE<\/a><\/strong><\/p>\n\n\n\n<p><mark>Input - Enter the number: 6<br>Output - factorial of 6 (dynamic) : 720<\/mark><\/p>\n\n\n\n<p>A dynamic programming solution is highly efficient in terms of time and space complexities.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"count-trailing-zeroes-in-factorial-using-python\"><strong>Count Trailing Zeroes in Factorial using Python<\/strong><gwmw style=\"display:none;\"><\/gwmw><\/h2>\n\n\n\n<p>Problem Statement: Count the number of zeroes in the factorial of a number using Python<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>num=int(input(\"Enter the number: \"))\n  \n# Initialize result \ncount = 0\n# Keep dividing n by \n# powers of 5 and \n# update Count \ntemp = 5\nwhile (num \/ temp&gt;= 1):\n    count += int(num \/ temp) \n    temp *= 5\n\n# Driver program  \nprint(\"Number of trailing zeros\", count)<\/code><\/pre>\n\n\n\n<p><mark>Output<br>Enter the Number: 5<br>Number of trailing zeros 1<\/mark><\/p>\n\n\n\n<p>Learn how to find <a href=\"https:\/\/www.mygreatlearning.com\/blog\/palindrome-in-python\/\">if a string is a Palindrome<\/a>. <\/p>\n\n\n\n<p>Learn how to print the <a href=\"https:\/\/www.mygreatlearning.com\/blog\/fibonacci-series-in-python\/\">Fibonacci Series in Python<\/a>. Also, <a href=\"https:\/\/www.mygreatlearning.com\/artificial-intelligence\/courses\">learn artificial intelligence online <\/a>with the help of this AI Course. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"frequently-asked-questions\"><strong>Frequently asked questions<\/strong><\/h2>\n\n\n\n<div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1673334874257\"><strong class=\"schema-faq-question\">1. <strong>What is factorial in math?<\/strong><\/strong> <p class=\"schema-faq-answer\"><strong>Factorial of a number, in mathematics<\/strong>, is the product of all positive integers less than or equal to a given positive number and denoted by that number and an exclamation point. Thus,\u00a0<strong>factorial<\/strong>\u00a0seven is written 4! meaning 1 \u00d7 2 \u00d7 3 \u00d7 4, equal to 24. Factorial\u00a0zero is defined as equal to 1. The factorial of Real and Negative numbers do not exist.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1673334890885\"><strong class=\"schema-faq-question\"><strong> 2. What is the formula of factorial? <\/strong><\/strong> <p class=\"schema-faq-answer\">To calculate the factorial of a number N, use this formula:<br\/>Factorial=1 x 2 x 3 x...x N-1 x N<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1673334908068\"><strong class=\"schema-faq-question\"><strong>3. Is there a factorial function in Python?<\/strong> <\/strong> <p class=\"schema-faq-answer\">Yes, we can import a module in Python known as math which contains almost all mathematical functions. To calculate factorial with a function, here is the code:<br\/><br\/>import math <br\/>num=int(input(\"Enter the number: \")) <br\/>print(\"factorial of \",num,\" (function): \",end=\"\") <br\/>print(math.factorial(num))<\/p> <\/div> <\/div>\n\n\n\n<p>Found this blog interesting? <a href=\"https:\/\/www.mygreatlearning.com\/artificial-intelligence\/courses\">Learn Artificial Intelligence Online<\/a> with the help of Great Learning's PGP Artificial Intelligence and Machine Learning course, and upskill today! While you're at it, check out the <a href=\"https:\/\/www.mygreatlearning.com\/academy\/learn-for-free\/courses\/python-fundamentals-for-beginners\">free python course for beginners<\/a> to learn more about the basic Python.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Factorial of a number N is defined by the product of N by all positive integers less than N<\/p>\n","protected":false},"author":41,"featured_media":12254,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[25860],"tags":[36796],"content_type":[],"class_list":["post-12147","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","tag-python"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Python Program to Find the Factorial of a Number<\/title>\n<meta name=\"description\" content=\"Python Program to Find the Factorial of a Number: Factorial Program in Python can be coded via Iteration, Recursion, and Dynamic Programming.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.mygreatlearning.com\/blog\/factorial-program-in-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Program to Find the Factorial of a Number\" \/>\n<meta property=\"og:description\" content=\"Python Program to Find the Factorial of a Number: Factorial Program in Python can be coded via Iteration, Recursion, and Dynamic Programming.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mygreatlearning.com\/blog\/factorial-program-in-python\/\" \/>\n<meta property=\"og:site_name\" content=\"Great Learning Blog: Free Resources what Matters to shape your Career!\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/GreatLearningOfficial\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-10T07:18:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-24T12:33:26+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-10-factorial-thumbnail-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"700\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Great Learning Editorial Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/Great_Learning\" \/>\n<meta name=\"twitter:site\" content=\"@Great_Learning\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Great Learning Editorial Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/factorial-program-in-python\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/factorial-program-in-python\\\/\"},\"author\":{\"name\":\"Great Learning Editorial Team\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\"},\"headline\":\"Python Program to Find the Factorial of a Number\",\"datePublished\":\"2023-01-10T07:18:54+00:00\",\"dateModified\":\"2024-10-24T12:33:26+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/factorial-program-in-python\\\/\"},\"wordCount\":865,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/factorial-program-in-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/Feb-10-factorial-thumbnail-1.png\",\"keywords\":[\"python\"],\"articleSection\":[\"IT\\\/Software Development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/factorial-program-in-python\\\/#respond\"]}]},{\"@type\":[\"WebPage\",\"FAQPage\"],\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/factorial-program-in-python\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/factorial-program-in-python\\\/\",\"name\":\"Python Program to Find the Factorial of a Number\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/factorial-program-in-python\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/factorial-program-in-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/Feb-10-factorial-thumbnail-1.png\",\"datePublished\":\"2023-01-10T07:18:54+00:00\",\"dateModified\":\"2024-10-24T12:33:26+00:00\",\"description\":\"Python Program to Find the Factorial of a Number: Factorial Program in Python can be coded via Iteration, Recursion, and Dynamic Programming.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/factorial-program-in-python\\\/#breadcrumb\"},\"mainEntity\":[{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/factorial-program-in-python\\\/#faq-question-1673334874257\"},{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/factorial-program-in-python\\\/#faq-question-1673334890885\"},{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/factorial-program-in-python\\\/#faq-question-1673334908068\"}],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/factorial-program-in-python\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/factorial-program-in-python\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/Feb-10-factorial-thumbnail-1.png\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/Feb-10-factorial-thumbnail-1.png\",\"width\":1000,\"height\":700,\"caption\":\"Factorial Python\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/factorial-program-in-python\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"IT\\\/Software Development\",\"item\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/software\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Python Program to Find the Factorial of a Number\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\",\"name\":\"Great Learning Blog\",\"description\":\"Learn, Upskill &amp; Career Development Guide and Resources\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"alternateName\":\"Great Learning\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\",\"name\":\"Great Learning\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/GL-Logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/GL-Logo.jpg\",\"width\":900,\"height\":900,\"caption\":\"Great Learning\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/GreatLearningOfficial\\\/\",\"https:\\\/\\\/x.com\\\/Great_Learning\",\"https:\\\/\\\/www.instagram.com\\\/greatlearningofficial\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/school\\\/great-learning\\\/\",\"https:\\\/\\\/in.pinterest.com\\\/greatlearning12\\\/\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/beaconelearning\\\/\"],\"description\":\"Great Learning is a leading global ed-tech company for professional training and higher education. It offers comprehensive, industry-relevant, hands-on learning programs across various business, technology, and interdisciplinary domains driving the digital economy. These programs are developed and offered in collaboration with the world's foremost academic institutions.\",\"email\":\"info@mygreatlearning.com\",\"legalName\":\"Great Learning Education Services Pvt. Ltd\",\"foundingDate\":\"2013-11-29\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"1001\",\"maxValue\":\"5000\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\",\"name\":\"Great Learning Editorial Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"caption\":\"Great Learning Editorial Team\"},\"description\":\"The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.\",\"sameAs\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/\",\"https:\\\/\\\/in.linkedin.com\\\/school\\\/great-learning\\\/\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/Great_Learning\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCObs0kLIrDjX2LLSybqNaEA\"],\"award\":[\"Best EdTech Company of the Year 2024\",\"Education Economictimes Outstanding Education\\\/Edtech Solution Provider of the Year 2024\",\"Leading E-learning Platform 2024\"],\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/author\\\/greatlearning\\\/\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/factorial-program-in-python\\\/#faq-question-1673334874257\",\"position\":1,\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/factorial-program-in-python\\\/#faq-question-1673334874257\",\"name\":\"1. What is factorial in math?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"<strong>Factorial of a number, in mathematics<\\\/strong>, is the product of all positive integers less than or equal to a given positive number and denoted by that number and an exclamation point. Thus,\u00a0<strong>factorial<\\\/strong>\u00a0seven is written 4! meaning 1 \u00d7 2 \u00d7 3 \u00d7 4, equal to 24. Factorial\u00a0zero is defined as equal to 1. The factorial of Real and Negative numbers do not exist.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/factorial-program-in-python\\\/#faq-question-1673334890885\",\"position\":2,\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/factorial-program-in-python\\\/#faq-question-1673334890885\",\"name\":\"2. What is the formula of factorial?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"To calculate the factorial of a number N, use this formula:<br\\\/>Factorial=1 x 2 x 3 x...x N-1 x N\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/factorial-program-in-python\\\/#faq-question-1673334908068\",\"position\":3,\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/factorial-program-in-python\\\/#faq-question-1673334908068\",\"name\":\"3. Is there a factorial function in Python?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Yes, we can import a module in Python known as math which contains almost all mathematical functions. To calculate factorial with a function, here is the code:<br\\\/><br\\\/>import math <br\\\/>num=int(input(\\\"Enter the number: \\\")) <br\\\/>print(\\\"factorial of \\\",num,\\\" (function): \\\",end=\\\"\\\") <br\\\/>print(math.factorial(num))\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Python Program to Find the Factorial of a Number","description":"Python Program to Find the Factorial of a Number: Factorial Program in Python can be coded via Iteration, Recursion, and Dynamic Programming.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.mygreatlearning.com\/blog\/factorial-program-in-python\/","og_locale":"en_US","og_type":"article","og_title":"Python Program to Find the Factorial of a Number","og_description":"Python Program to Find the Factorial of a Number: Factorial Program in Python can be coded via Iteration, Recursion, and Dynamic Programming.","og_url":"https:\/\/www.mygreatlearning.com\/blog\/factorial-program-in-python\/","og_site_name":"Great Learning Blog: Free Resources what Matters to shape your Career!","article_publisher":"https:\/\/www.facebook.com\/GreatLearningOfficial\/","article_published_time":"2023-01-10T07:18:54+00:00","article_modified_time":"2024-10-24T12:33:26+00:00","og_image":[{"width":1000,"height":700,"url":"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-10-factorial-thumbnail-1.png","type":"image\/png"}],"author":"Great Learning Editorial Team","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/Great_Learning","twitter_site":"@Great_Learning","twitter_misc":{"Written by":"Great Learning Editorial Team","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.mygreatlearning.com\/blog\/factorial-program-in-python\/#article","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/factorial-program-in-python\/"},"author":{"name":"Great Learning Editorial Team","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad"},"headline":"Python Program to Find the Factorial of a Number","datePublished":"2023-01-10T07:18:54+00:00","dateModified":"2024-10-24T12:33:26+00:00","mainEntityOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/factorial-program-in-python\/"},"wordCount":865,"commentCount":0,"publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/factorial-program-in-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-10-factorial-thumbnail-1.png","keywords":["python"],"articleSection":["IT\/Software Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.mygreatlearning.com\/blog\/factorial-program-in-python\/#respond"]}]},{"@type":["WebPage","FAQPage"],"@id":"https:\/\/www.mygreatlearning.com\/blog\/factorial-program-in-python\/","url":"https:\/\/www.mygreatlearning.com\/blog\/factorial-program-in-python\/","name":"Python Program to Find the Factorial of a Number","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/factorial-program-in-python\/#primaryimage"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/factorial-program-in-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-10-factorial-thumbnail-1.png","datePublished":"2023-01-10T07:18:54+00:00","dateModified":"2024-10-24T12:33:26+00:00","description":"Python Program to Find the Factorial of a Number: Factorial Program in Python can be coded via Iteration, Recursion, and Dynamic Programming.","breadcrumb":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/factorial-program-in-python\/#breadcrumb"},"mainEntity":[{"@id":"https:\/\/www.mygreatlearning.com\/blog\/factorial-program-in-python\/#faq-question-1673334874257"},{"@id":"https:\/\/www.mygreatlearning.com\/blog\/factorial-program-in-python\/#faq-question-1673334890885"},{"@id":"https:\/\/www.mygreatlearning.com\/blog\/factorial-program-in-python\/#faq-question-1673334908068"}],"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mygreatlearning.com\/blog\/factorial-program-in-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/factorial-program-in-python\/#primaryimage","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-10-factorial-thumbnail-1.png","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-10-factorial-thumbnail-1.png","width":1000,"height":700,"caption":"Factorial Python"},{"@type":"BreadcrumbList","@id":"https:\/\/www.mygreatlearning.com\/blog\/factorial-program-in-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/www.mygreatlearning.com\/blog\/"},{"@type":"ListItem","position":2,"name":"IT\/Software Development","item":"https:\/\/www.mygreatlearning.com\/blog\/software\/"},{"@type":"ListItem","position":3,"name":"Python Program to Find the Factorial of a Number"}]},{"@type":"WebSite","@id":"https:\/\/www.mygreatlearning.com\/blog\/#website","url":"https:\/\/www.mygreatlearning.com\/blog\/","name":"Great Learning Blog","description":"Learn, Upskill &amp; Career Development Guide and Resources","publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"alternateName":"Great Learning","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.mygreatlearning.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization","name":"Great Learning","url":"https:\/\/www.mygreatlearning.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg","width":900,"height":900,"caption":"Great Learning"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/GreatLearningOfficial\/","https:\/\/x.com\/Great_Learning","https:\/\/www.instagram.com\/greatlearningofficial\/","https:\/\/www.linkedin.com\/school\/great-learning\/","https:\/\/in.pinterest.com\/greatlearning12\/","https:\/\/www.youtube.com\/user\/beaconelearning\/"],"description":"Great Learning is a leading global ed-tech company for professional training and higher education. It offers comprehensive, industry-relevant, hands-on learning programs across various business, technology, and interdisciplinary domains driving the digital economy. These programs are developed and offered in collaboration with the world's foremost academic institutions.","email":"info@mygreatlearning.com","legalName":"Great Learning Education Services Pvt. Ltd","foundingDate":"2013-11-29","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"1001","maxValue":"5000"}},{"@type":"Person","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad","name":"Great Learning Editorial Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","caption":"Great Learning Editorial Team"},"description":"The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.","sameAs":["https:\/\/www.mygreatlearning.com\/","https:\/\/in.linkedin.com\/school\/great-learning\/","https:\/\/x.com\/https:\/\/twitter.com\/Great_Learning","https:\/\/www.youtube.com\/channel\/UCObs0kLIrDjX2LLSybqNaEA"],"award":["Best EdTech Company of the Year 2024","Education Economictimes Outstanding Education\/Edtech Solution Provider of the Year 2024","Leading E-learning Platform 2024"],"url":"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/"},{"@type":"Question","@id":"https:\/\/www.mygreatlearning.com\/blog\/factorial-program-in-python\/#faq-question-1673334874257","position":1,"url":"https:\/\/www.mygreatlearning.com\/blog\/factorial-program-in-python\/#faq-question-1673334874257","name":"1. What is factorial in math?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"<strong>Factorial of a number, in mathematics<\/strong>, is the product of all positive integers less than or equal to a given positive number and denoted by that number and an exclamation point. Thus,\u00a0<strong>factorial<\/strong>\u00a0seven is written 4! meaning 1 \u00d7 2 \u00d7 3 \u00d7 4, equal to 24. Factorial\u00a0zero is defined as equal to 1. The factorial of Real and Negative numbers do not exist.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/www.mygreatlearning.com\/blog\/factorial-program-in-python\/#faq-question-1673334890885","position":2,"url":"https:\/\/www.mygreatlearning.com\/blog\/factorial-program-in-python\/#faq-question-1673334890885","name":"2. What is the formula of factorial?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"To calculate the factorial of a number N, use this formula:<br\/>Factorial=1 x 2 x 3 x...x N-1 x N","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/www.mygreatlearning.com\/blog\/factorial-program-in-python\/#faq-question-1673334908068","position":3,"url":"https:\/\/www.mygreatlearning.com\/blog\/factorial-program-in-python\/#faq-question-1673334908068","name":"3. Is there a factorial function in Python?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Yes, we can import a module in Python known as math which contains almost all mathematical functions. To calculate factorial with a function, here is the code:<br\/><br\/>import math <br\/>num=int(input(\"Enter the number: \")) <br\/>print(\"factorial of \",num,\" (function): \",end=\"\") <br\/>print(math.factorial(num))","inLanguage":"en-US"},"inLanguage":"en-US"}]}},"uagb_featured_image_src":{"full":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-10-factorial-thumbnail-1.png",1000,700,false],"thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-10-factorial-thumbnail-1-150x150.png",150,150,true],"medium":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-10-factorial-thumbnail-1-300x210.png",300,210,true],"medium_large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-10-factorial-thumbnail-1-768x538.png",768,538,true],"large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-10-factorial-thumbnail-1.png",1000,700,false],"1536x1536":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-10-factorial-thumbnail-1.png",1000,700,false],"2048x2048":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-10-factorial-thumbnail-1.png",1000,700,false],"web-stories-poster-portrait":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-10-factorial-thumbnail-1.png",640,448,false],"web-stories-publisher-logo":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-10-factorial-thumbnail-1.png",96,67,false],"web-stories-thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-10-factorial-thumbnail-1.png",150,105,false]},"uagb_author_info":{"display_name":"Great Learning Editorial Team","author_link":"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/"},"uagb_comment_info":1,"uagb_excerpt":"Factorial of a number N is defined by the product of N by all positive integers less than N","_links":{"self":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/12147","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/comments?post=12147"}],"version-history":[{"count":43,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/12147\/revisions"}],"predecessor-version":[{"id":110869,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/12147\/revisions\/110869"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media\/12254"}],"wp:attachment":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media?parent=12147"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/categories?post=12147"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/tags?post=12147"},{"taxonomy":"content_type","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/content_type?post=12147"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}