Automatic increment

Gheorghe Postelnicu gheorghe.postelnicu at gmail.com
Thu Nov 30 13:08:16 EST 2006


Hi,

I have a situation of the following type:

for line in lineList:
    for item in line.split()
        myArray[counter, itemCounter]
        itemCounter = itemCounter + 1
    counter = counter +1

Is there a way to get rid of the manual incrementation of the 2 counters?

Thanks,
-- 
Gheorghe Postelnicu, PhD
MGH, Harvard Medical School



More information about the Python-list mailing list