From ed94d646cced21f0d03e114bcbff9b7e0de8038d Mon Sep 17 00:00:00 2001 From: asharaya singh bhadauriya <118126127+Aashray24092000@users.noreply.github.com> Date: Tue, 4 Jul 2023 13:41:39 +0530 Subject: [PATCH] Update factorial.py --- factorial.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/factorial.py b/factorial.py index 17d78c5..6820c3e 100644 --- a/factorial.py +++ b/factorial.py @@ -8,3 +8,14 @@ def factorial(n): print factorial(-6) + +#another way of find factorial + +def f(n): + fact=1 + while n>1: + fact=fact*n + n=n-1 + print( fact) + +f(5)