Last active
October 27, 2020 10:38
-
-
Save Kush1101/b4521aec484c906ebda20ff850123f88 to your computer and use it in GitHub Desktop.
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
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