Skip to content

Instantly share code, notes, and snippets.

@Kush1101
Last active October 27, 2020 10:38
Embed
What would you like to do?
from itertools import cycle
count = 0
iterable = ["Python", "is", "awesome."]
generator = cycle(iterable)
for i in range(6):
print(next(generator, end = ' ')
# OUTPUT
'''
Python is awesome. Python is awesome.
'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment