Created
September 9, 2018 19:54
-
-
Save jb0hn/70577876fedb61ae0e21e39b014792c5 to your computer and use it in GitHub Desktop.
Simple fibonacci sequence generator (<255)
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
# init var | |
x = 0 | |
y= 1 | |
# main loop | |
while True: | |
print(x) # print result | |
# calculations | |
z = x + y | |
x = y | |
y = z | |
# condition to print numbers up to 255 | |
if x >= 255: | |
break | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment