Skip to content

Instantly share code, notes, and snippets.

@saivenkat
Created October 25, 2009 13:47
Show Gist options
  • Select an option

  • Save saivenkat/218065 to your computer and use it in GitHub Desktop.

Select an option

Save saivenkat/218065 to your computer and use it in GitHub Desktop.
infinite fibonacci list
def fibonacci():
i = j = 1
while True:
result, i, j = i, j, i + j
yield result
for k in fibonacci():
print k
if (k > 100) : break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment