Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def recursion_factorial(n):
- if n == 1:
- return n
- else:
- return n*recursion_factorial(n-1)
- find_factorial = 5
- if find_factorial < 0:
- print("Sorry, factorial does not exist for negative numbers")
- elif find_factorial == 0:
- print("The factorial of 0 is 1")
- else:
- print("The factorial of", find_factorial, "is", recursion_factorial(find_factorial))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement