Skip to content

Instantly share code, notes, and snippets.

@YannickSF
Created November 15, 2021 21:42
Show Gist options
  • Save YannickSF/e24383d03c766b1d1bde12c174b09590 to your computer and use it in GitHub Desktop.
Save YannickSF/e24383d03c766b1d1bde12c174b09590 to your computer and use it in GitHub Desktop.
fibonacci algorithm
I0 = 0
I1 = 1
def fibonacci(high):
results = [I0, I1]
[results.append(results[v] + results[v + 1]) for v in range(high)]
return results
def fibonacci_factor(initial_value, high):
high_fibonacci = fibonacci(high)
return [initial_value * high_fibonacci[w] for w in range(high)]
if __name__ == '__main__':
# for i in fibonacci(10):
for i in fibonacci_factor(180, 10):
print(i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment