Skip to content

Instantly share code, notes, and snippets.

@Deep18-03
Created April 19, 2020 14:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Deep18-03/a7d6968b835906d25d29d4175b71a364 to your computer and use it in GitHub Desktop.
Save Deep18-03/a7d6968b835906d25d29d4175b71a364 to your computer and use it in GitHub Desktop.
#factorial
def factorial(n):
"""
5*4*3*2*1
"""
if n==1:
return 1
else:
return n*factorial(n-1)
number=int(input("enter the number"))
print(factorial(number))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment