<p><pre><code>    &#62;&#62;&#62; from itertools import cycle
    &#62;&#62;&#62; iter = cycle(['red', 'green', 'blue'])
    &#62;&#62;&#62; iter.next()
    'red'
    &#62;&#62;&#62; iter.next()
    'green'
    &#62;&#62;&#62; iter.next()
    'blue'
    &#62;&#62;&#62; iter.next()
    'red'</code></pre>