Learn about ther itertools module, one of the most useful and elegant modules in the standard library (http://docs.python.org/lib/module-itertools.html):
import itertools as it colors = ["#ff0000", "#00FF00", "#0000FF"] words = "Itertools is a pretty neat module".split() for word_color in it.izip(word, it.cycle(colors)): print "<font color=%s>%s</font>" % word_color George -- http://mail.python.org/mailman/listinfo/python-list