diff --git a/Python Programs/factorial.py b/Python Programs/factorial.py new file mode 100644 index 0000000..d793644 --- /dev/null +++ b/Python Programs/factorial.py @@ -0,0 +1,10 @@ +n = int(input("Enter the limit:")) +fact = 1 +if (n == 0): + print("Factorial is 1") +elif (n < 0): + print("Can't find the factorial") +else: + for i in range(1,n+1): + fact = fact * i + print("The factorial of",n,"is ",fact) \ No newline at end of file