Skip to content

Instantly share code, notes, and snippets.

@ArthurDeveloper
Created August 14, 2021 17:50
Show Gist options
  • Save ArthurDeveloper/9bc3c867f40eeee71a9d9d2f5cad3daa to your computer and use it in GitHub Desktop.
Save ArthurDeveloper/9bc3c867f40eeee71a9d9d2f5cad3daa to your computer and use it in GitHub Desktop.
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