Skip to content

Instantly share code, notes, and snippets.

@Marva82
Created June 6, 2018 20:58
Show Gist options
  • Save Marva82/abede3a0c8de20865892a0d0f6b0133b to your computer and use it in GitHub Desktop.
Save Marva82/abede3a0c8de20865892a0d0f6b0133b to your computer and use it in GitHub Desktop.
Small code snippet showing simple recursion in Python
#Showing simple recursion example
def recursionFunc(input):
if input <= 1:
return 1
else:
return input * recursionFunc(input - 1)
someInput = recursionFunc(4)
print(someInput)
4*3*2*1 = 24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment