Last active
May 26, 2023 15:27
-
-
Save mtraynham/4bd68d740b72bfc2873c5ec5316ce227 to your computer and use it in GitHub Desktop.
fib.py
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(n): | |
if n <= 1: | |
return n | |
else: | |
return fibonacci(n-1) + fibonacci(n - 2) | |
def main(): | |
num_Terms = 1000 | |
fibSequence = [] | |
for i in range(num_terms): | |
fibSequence.append(fibonacci(i)) | |
print(fib_sequence) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment