Created
August 14, 2021 17:50
-
-
Save ArthurDeveloper/9bc3c867f40eeee71a9d9d2f5cad3daa 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 fib(termsQtt): | |
term = 1 | |
lastTerm = 0 | |
terms = [] | |
while len(terms) < termsQtt: | |
terms.append(lastTerm + term) | |
term, lastTerm = lastTerm, term+lastTerm | |
return terms | |
print(fib(12)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment