Skip to content

Instantly share code, notes, and snippets.

@f3rdy
Last active March 21, 2016 15:44
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 f3rdy/80e9efd5c19df5a13cb9 to your computer and use it in GitHub Desktop.
Save f3rdy/80e9efd5c19df5a13cb9 to your computer and use it in GitHub Desktop.
A simple test to provide code for a gist
def fib(maximum):
"""
Calculate the fibonacci numbers below maximum
:param maximum: the maximum number
:return: a list containing fibonacci numbers
"""
a, b = 1, 1
result = [a, b]
while True:
a, b = b, b+a
if b < maximum:
result.append(b)
else:
return result
def main():
for i in fib(5000):
print i
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment