Skip to content

Instantly share code, notes, and snippets.

@rajanand
Last active September 8, 2015 18:45
Show Gist options
  • Save rajanand/69a433ac9f2bd4b0b27f to your computer and use it in GitHub Desktop.
Save rajanand/69a433ac9f2bd4b0b27f to your computer and use it in GitHub Desktop.
To find factorial in python using recursive function
#factorial in python using recursion
# visualize: http://go.rajanand.org/python_factorial_function
def fact(n):
if n==1:
return n
return n*fact(n-1)
print fact(5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment