Skip to content

Instantly share code, notes, and snippets.

@kevinschoon
Last active January 8, 2016 13:25
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 kevinschoon/1e6a9a9a0536f1936bdd to your computer and use it in GitHub Desktop.
Save kevinschoon/1e6a9a9a0536f1936bdd to your computer and use it in GitHub Desktop.
recurse
import sys
def recurse(count=0):
count += 1
if count + 2 < sys.getrecursionlimit():
recurse(count)
else:
answer = raw_input("YOU HAVE REACHED {} DO YOU DARE TO CONTINUE?! [yes/no/whatev]: ".format(count))
if answer == "yes":
sys.setrecursionlimit(sys.getrecursionlimit() + 1)
recurse(count)
elif answer == "whatev":
recurse(count)
print("Amature!")
if __name__ == '__main__':
recurse()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment