-
-
Save Toastdude/ec6462481524e69253fa to your computer and use it in GitHub Desktop.
This file contains 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(n): | |
f = open('Fibonacci.txt','w') | |
f.write("0\n") | |
i = 1 | |
a, b = 0, 1 | |
while i < n: | |
text = str(b) | |
f.write(text+'\n') | |
a, b = b, a+b | |
i = i + 1 | |
f.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment