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
#standard recursive function to find fibonacci numbers | |
#extremely slow. needs to find the value of all preceding fibonacci numbers each time | |
def fibonacci(n): | |
if n == 0: | |
return 0 | |
elif n == 1: | |
return 1 | |
return fib(n-1)+fib(n-2) |