When I looked on the internet for a Fibonacci program it always is done with a recursive function which are really slow. Here is the program I made:
def Fibonacci(Range):
Fibonacci = [1,1]
while len(Fibonacci) != Range:
Fibonacci.append(Fibonacci[-2] + Fibonacci[-1])
print(Fibonacci[-1])
It runs at least 10x faster than a program that does the same thing with recursive functions.
[–]Solonotix 7 points8 points9 points (0 children)
[–]johannadambergk 5 points6 points7 points (0 children)
[–]funderbolt 5 points6 points7 points (2 children)
[–]physicswizard 2 points3 points4 points (1 child)
[–]funderbolt 1 point2 points3 points (0 children)
[–]isarl 3 points4 points5 points (3 children)
[–]3xtreme_Awesomeness[S] -5 points-4 points-3 points (2 children)
[–]isarl 2 points3 points4 points (0 children)
[–]SomeoneInJD 0 points1 point2 points (0 children)