{"id":1478,"date":"2018-02-16T23:46:01","date_gmt":"2018-02-16T23:46:01","guid":{"rendered":"http:\/\/zatizi.com\/?p=1478"},"modified":"2018-02-16T23:46:01","modified_gmt":"2018-02-16T23:46:01","slug":"factorial-recursive-function-in-python","status":"publish","type":"post","link":"https:\/\/zatizi.com\/?p=1478","title":{"rendered":"Factorial recursive function in Python ?"},"content":{"rendered":"<pre>def factorial (x):\n    if x == 1: # base condition\n        return 1\n    else:\n        y = factorial (x-1)\n        print (y,\"*\",x,\"=\",x * y)\n        return (x * y)\n\n# testing factorial function for a given number\nnumber = 50\nprint (\"Computing\", number, \"!\")\nfactorial (number)\n\n# program: Factorial recursive function\n# implementation in Python 3.x: A.-P. Gaspar\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>def factorial (x): if x == 1: # base condition return 1 else: y = factorial (x-1) print (y,&#8221;*&#8221;,x,&#8221;=&#8221;,x * y) return (x * y) # testing factorial function for a given number number = 50 print (&#8220;Computing&#8221;, number, &#8220;!&#8221;) factorial (number) # program: Factorial recursive function # implementation in Python 3.x: A.-P. Gaspar<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[52],"tags":[331,610],"persona":[],"class_list":["post-1478","post","type-post","status-publish","format-standard","hentry","category-programming-en","tag-factorial","tag-python","missing-thumbnail"],"_links":{"self":[{"href":"https:\/\/zatizi.com\/index.php?rest_route=\/wp\/v2\/posts\/1478","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zatizi.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zatizi.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zatizi.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zatizi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1478"}],"version-history":[{"count":0,"href":"https:\/\/zatizi.com\/index.php?rest_route=\/wp\/v2\/posts\/1478\/revisions"}],"wp:attachment":[{"href":"https:\/\/zatizi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1478"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zatizi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1478"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zatizi.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1478"},{"taxonomy":"persona","embeddable":true,"href":"https:\/\/zatizi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fpersona&post=1478"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}