Skip to content

Instantly share code, notes, and snippets.

@NISH1001
Created October 1, 2020 15:32
Show Gist options
  • Save NISH1001/97868381ba2a76c3aee4319cbe908450 to your computer and use it in GitHub Desktop.
Save NISH1001/97868381ba2a76c3aee4319cbe908450 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
def fib(n):
res = [1,1]
for i in range(n):
res.append(sum(res[-2:]))
return res
def main():
seq = fib(20)
for s1, s2 in zip(seq, seq[1:]):
print(s2 / s1)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment