Created
February 26, 2019 19:36
-
-
Save kristovatlas/0789e53abce7148b48ff9bbe9668c984 to your computer and use it in GitHub Desktop.
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
NUM_FIB_NUMS = 100 | |
F1 = 0 | |
F2 = 1 | |
POS = 2 | |
print "0,0" | |
print "1,1" | |
for count in range(1, NUM_FIB_NUMS + 1): | |
fsum = F1 + F2 | |
fsum_str = str(fsum) #mutable | |
while len(fsum_str) > 0: | |
fsum_chr = fsum_str[0:1] | |
fsum_str = fsum_str[1:] | |
print "{POS},{fsum_chr}".format(POS=POS, fsum_chr=fsum_chr) | |
POS += 1 | |
F1 = F2 | |
F2 = fsum |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment