Created
September 29, 2014 19:21
-
-
Save akaptur/e4644b765139a876c968 to your computer and use it in GitHub Desktop.
frame counter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def depth_one(n): | |
def depth_two(n): | |
def countdown(n, times_called=[0]): | |
times_called[0] += 1 | |
if n == 0: | |
return times_called | |
else: | |
try: | |
return countdown(n-1) | |
except RuntimeError: | |
return countdown(n-1) | |
# return times_called | |
return countdown(n) | |
return depth_two(n) | |
print depth_one(10) | |
print depth_one(100) | |
print depth_one(1000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment