Guest User

Untitled

a guest
Feb 18th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. n = int(input('Enter the number of n: '))
  2.  
  3.  
  4. def fact(n):
  5. # Base Case
  6. if n == 1:
  7. return 1
  8. # Recursive case
  9. else:
  10. return n * fact(n - 1)
  11.  
  12.  
  13. print(fact(n))
Add Comment
Please, Sign In to add comment