Python‎ > ‎itertools‎ > ‎

itertools.cycle()

http://www.adilwaseem.com/

Definition
Return elements from the iterable until it is exhausted. Then repeat the sequence indefinitely.

Syntax
cycle(iterable) --> cycle object

Parameters
iterable

Example
The return is:
 import itertools
set={"Python", "Lake", "learning", "Center"}
y=itertools.cycle(set)
for value in y: print(value)

>>>
Indefinite recurrence of values will start.
>>>

Comments