Skip to content

Instantly share code, notes, and snippets.

@ppeuchin
Created September 19, 2021 14:18
Show Gist options
  • Save ppeuchin/9b8a8525b1dc6b40e5591909ec58c5c5 to your computer and use it in GitHub Desktop.
Save ppeuchin/9b8a8525b1dc6b40e5591909ec58c5c5 to your computer and use it in GitHub Desktop.
A program that returns the factorial of a number
# using recursion
def factorial(x):
if x == 1:
return 1
else:
return x * factorial(x - 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment