Counting iterations

Derek Basch dbasch at yahoo.com
Fri Apr 8 18:21:01 EDT 2005


ooops you are right. Should have been:

pets = ["cat", "dog", "bird"]
num_pets = 0
for i in pets:
    num_pets += 1
    print "pet" + "#" + num_pets

That's the problem with one offs. I don't read them :).




More information about the Python-list mailing list