From 914096562391b76658dd627704b7db4d3ad34969 Mon Sep 17 00:00:00 2001 From: asharaya singh bhadauriya <118126127+Aashray24092000@users.noreply.github.com> Date: Fri, 7 Jul 2023 01:37:56 +0530 Subject: [PATCH] Update 100+ Python challenging programming exercises for Python 3.md --- ... challenging programming exercises for Python 3.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/100+ Python challenging programming exercises for Python 3.md b/100+ Python challenging programming exercises for Python 3.md index c4ba62c4..73d67674 100644 --- a/100+ Python challenging programming exercises for Python 3.md +++ b/100+ Python challenging programming exercises for Python 3.md @@ -66,6 +66,17 @@ def fact(x): x=int(input()) print(fact(x)) ``` +#second method + +def factorial(n): + fact=1 + while n >= 1: + fact=fact*n + n=n-1 + return fact +x=int(input("enter number")) +factorial(x) + ### Question 3 Level 1