Skip to content

Instantly share code, notes, and snippets.

@JackDanger
Created March 13, 2014 00:00
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 JackDanger/9519283 to your computer and use it in GitHub Desktop.
Save JackDanger/9519283 to your computer and use it in GitHub Desktop.
Recursion!
def a_little_recursion(n):
if n > 100:
print "all done!"
print "not done yet!"
return
a_little_recursion(n + 1)
a_little_recursion(0)
def recurse_just_once(should_i_stop):
if should_i_stop:
print "stop now!"
return
recurse_just_once(True)
recurse_just_once(False)
def too_much_recursion(n):
print n
return recurse(n + 1)
too_much_recursion(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment