Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python3
- #The program for calculating n! recursively
- def fac(n):
- """n! recursive"""
- if n == 0:
- return 1
- return fac(n-1) * n
- n = int(input('Enter positive integer:\n>'))
- print("Factorial",(n),":",fac(n))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement