Skip to content

Instantly share code, notes, and snippets.

@bee-san
Created March 29, 2019 23:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bee-san/fc2d5031710d3618e9468cf10c1552ff to your computer and use it in GitHub Desktop.
Save bee-san/fc2d5031710d3618e9468cf10c1552ff to your computer and use it in GitHub Desktop.
def f(n):
if n == 0 or n == 1:
return 1
else:
fibo = 1
fibroPrev = 1
for i in range (2, n):
temp = fibo
fibo = fibo + fiboPrev
fiboPrev = temp
return fibo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment