Created
October 1, 2020 15:32
-
-
Save NISH1001/97868381ba2a76c3aee4319cbe908450 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
#!/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