Skip to content

Instantly share code, notes, and snippets.

@SpotlightKid
Last active August 29, 2015 13:56
Show Gist options
  • Save SpotlightKid/8942525 to your computer and use it in GitHub Desktop.
Save SpotlightKid/8942525 to your computer and use it in GitHub Desktop.
cpdef int fib(int n):
if n == 2:
return 2
elif n < 0:
raise NotImplementedError
elif n <= 1:
return 1
else:
return fib(n-1) + fib(n-2)
if __name__ == '__main__':
print(fib(40))
@JoaoGFarias
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment