Created
December 21, 2017 11:42
-
-
Save faruken/987527bc5599afe079fdfcfabe4c1579 to your computer and use it in GitHub Desktop.
lol fibonacci
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 fibonacci(n): | |
i = 1 | |
while (((i & 0xffff0000) >> 16) + (i & 0xffff) <= 0xffff): | |
print '%d' % (i & 0xff), | |
i = ((i & 0xffff) << 16) | ((i >> 16) + (i & 0xffff)) | |
if __name__=='__main__': | |
fibonacci(10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment