circular iteration

Flavio codeco coelho fccoelho at gmail.com
Fri Jan 21 11:31:02 EST 2005


hi,

is there a faster way to build a circular iterator in python that by doing this:

c=['r','g','b','c','m','y','k']

for i in range(30):
    print c[i%len(c)]

thanks,

Flávio



More information about the Python-list mailing list