Skip to content

Instantly share code, notes, and snippets.

@Fhernd
Created June 16, 2018 01:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fhernd/56f7447375f82174416c4f5010d8832f to your computer and use it in GitHub Desktop.
Save Fhernd/56f7447375f82174416c4f5010d8832f to your computer and use it in GitHub Desktop.
Uso de islice() para crear una sección de un objeto iterador. OrtizOL.
import itertools
def contador(n):
while True:
yield n
n += 1
c = contador(0)
for x in itertools.islice(c, 10, 20):
print(x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment