Skip to content

Instantly share code, notes, and snippets.

@khuyentran1401
Created April 28, 2021 11:36
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 khuyentran1401/04b81b80e41ba9ce2aa2fda818aa9729 to your computer and use it in GitHub Desktop.
Save khuyentran1401/04b81b80e41ba9ce2aa2fda818aa9729 to your computer and use it in GitHub Desktop.
import snoop
@snoop
def factorial(x):
if x == 1:
return 1
else:
return (x * factorial(x-1))
if __name__ == "__main__":
num = 5
print(f"The factorial of {num} is {factorial(num)}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment