Skip to content

Instantly share code, notes, and snippets.

@kristovatlas
Created February 26, 2019 19:36
Show Gist options
  • Save kristovatlas/0789e53abce7148b48ff9bbe9668c984 to your computer and use it in GitHub Desktop.
Save kristovatlas/0789e53abce7148b48ff9bbe9668c984 to your computer and use it in GitHub Desktop.
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