Skip to content

Instantly share code, notes, and snippets.

@categulario
Created August 16, 2012 16:53
Show Gist options
  • Save categulario/3371631 to your computer and use it in GitHub Desktop.
Save categulario/3371631 to your computer and use it in GitHub Desktop.
bucle for infinito en python
def inf(i=0, step=1):
#un generador de iteradores infinitos, como el xrange, pero infinito
while True:
yield i
i+=step
for i in inf():
print i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment