modifying iterator value.

Thomas Nelson thn at mail.utexas.edu
Wed Apr 26 16:27:42 EDT 2006


There is also this way:

for index in range(len(someList)):
    someList[index] = 1

This is not as pretty or concise as enumerate(), but if you've never
seen that function before this may be more clear.  I assume you're
familiar with the way range and len work.

THN




More information about the Python-list mailing list