From 47b0c07c28856f68411533508c98b41ed8c83bca Mon Sep 17 00:00:00 2001 From: mihirapappu <44111392+mihirapappu@users.noreply.github.com> Date: Thu, 3 Oct 2019 21:54:33 +0530 Subject: [PATCH] factorial of a number --- factorial of a number | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 factorial of a number diff --git a/factorial of a number b/factorial of a number new file mode 100644 index 0000000..a58fc51 --- /dev/null +++ b/factorial of a number @@ -0,0 +1,7 @@ +def factorial(n): + if n == 0: + return 1 + else: + return n * factorial(n-1) +n=int(input("Input a number to compute the factiorial : ")) +print(factorial(n))