Fredrik Lundh wrote: > what's kludgy with using a counter to count things ?
Ohhh, nothing in particular. Just seeing if there is a better way to do it. > (the real question here is of course why you need the counter. what's > the loop doing? if the code you posted is all you have, you can replace > it with index = sum(len(animal) for animal in zoo), but I assume you want > to do more stuff in there...) > > </F> Yes, I am doing more. Your example assumes that all that animals have the same amount of colors. Not a bad assumption considering I didn't say anything about that. Looks like good old counters are they way to go then. -- http://mail.python.org/mailman/listinfo/python-list