Skip to content

Instantly share code, notes, and snippets.

@zkan
Created February 24, 2019 13:12
Show Gist options
  • Save zkan/ccfdc4e04b5f1b50ce647084adc67fc6 to your computer and use it in GitHub Desktop.
Save zkan/ccfdc4e04b5f1b50ce647084adc67fc6 to your computer and use it in GitHub Desktop.
def fibonacci():
current_value, next_value = 0, 1
while True:
yield current_value
current_value, next_value = next_value, current_value + next_value
result = fibonacci()
for _ in range(10000000000000):
print(next(result))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment