From 52f5febafe65fbbb8f8f0ebdb8cb80a1d96ff65e Mon Sep 17 00:00:00 2001 From: Neetansh <56220285+Neetansh@users.noreply.github.com> Date: Mon, 7 Oct 2019 12:46:03 +0530 Subject: [PATCH] Create facto.py --- facto.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 facto.py diff --git a/facto.py b/facto.py new file mode 100644 index 00000000..a58fc519 --- /dev/null +++ b/facto.py @@ -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))