From b75bde326582da44d865828424123b0f3b5f67fb Mon Sep 17 00:00:00 2001 From: Aashray24092000 <118126127+Aashray24092000@users.noreply.github.com> Date: Wed, 28 Jun 2023 10:40:21 +0530 Subject: [PATCH] Update factorial.py --- factorial.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/factorial.py b/factorial.py index 8e4a65ea..70afc1a4 100644 --- a/factorial.py +++ b/factorial.py @@ -1,11 +1,3 @@ -def get_recursive_factorial(n): - if n < 0: - return -1 - elif n < 2: - return 1 - else: - return n * get_recursive_factorial(n-1) - def get_iterative_factorial(n): if n < 0: return -1 @@ -15,5 +7,4 @@ def get_iterative_factorial(n): fact *= i return fact print("input should be an integer") -print(get_recursive_factorial(6)) -print(get_iterative_factorial(6)) +print(get_iterative_factorial(5))