Created
January 18, 2016 20:17
-
-
Save brantfaircloth/04f6ec1924ea71084e09 to your computer and use it in GitHub Desktop.
fibo function
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
def fib(n): # write Fibonacci series up to n | |
a, b = 0, 1 | |
while b < n: | |
print b, | |
a, b = b, a+b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment