Created
August 4, 2025 15:33
-
-
Save jasoncartwright/d7ef600aa09b3065093cb3a53b192088 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 fibonacci_sequence(n): | |
if n <= 0: | |
return [] | |
elif n == 1: | |
return [0] | |
elif n == 2: | |
return [0, 1] | |
fib_sequence = [0, 1] | |
for i in range(2, n): | |
next_value = fib_sequence[i - 1] + fib_sequence[i - 2] | |
fib_sequence.append(next_value) | |
return fib_sequence | |
print(fibonacci_sequence(100)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment