Is there a better way to count iterations that this?:
pets = 0 for i in pets: pets += 1 print "pet" + "#" + pets
for i, pet in enumerate(pets): print 'pet#%i' % (i + 1)
STeVe -- http://mail.python.org/mailman/listinfo/python-list
Is there a better way to count iterations that this?:
pets = 0 for i in pets: pets += 1 print "pet" + "#" + pets
for i, pet in enumerate(pets): print 'pet#%i' % (i + 1)
STeVe -- http://mail.python.org/mailman/listinfo/python-list