Write a Python function to calculate the factorial of a number. I have used python 3.7 compiler for debugging purpose.
def factorial(num): if num == 0: return 1 else: return num * factorial(num-1) num=int(input("Input a number to compute the factiorial : ")) print(factorial(num))
27 July 2019 1716 Written By: Rohit
© 2020 Tech Study. All rights reserved | Developed by Tech Study| Privacy Policy | Sitemap