Skip to content

Instantly share code, notes, and snippets.

@Toastdude

Toastdude/Fib.py Secret

Created March 8, 2012 01:33
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 Toastdude/ec6462481524e69253fa to your computer and use it in GitHub Desktop.
Save Toastdude/ec6462481524e69253fa to your computer and use it in GitHub Desktop.
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