Created
June 16, 2018 01:08
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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