Skip to content

Instantly share code, notes, and snippets.

@saivenkat
Created October 25, 2009 13:29
Show Gist options
  • Save saivenkat/218062 to your computer and use it in GitHub Desktop.
Save saivenkat/218062 to your computer and use it in GitHub Desktop.
infinite list
def increment():
i = 0
while True:
yield i
i += 1
for j in increment():
print i
if (j > 10) : break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment