Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def factorial(n):
- global fctrl
- fctrl=1
- while n>1:
- fctrl=fctrl*n
- n=n-1
- n=int(input("ENTER A NUMBER TO FIND THE FACTORIAL OF : "))
- factorial(n)
- print("The factorial of",n,"is",fctrl)
- input("PRESS ENTER TO END THE PROGRAM")
Advertisement
Add Comment
Please, Sign In to add comment