modifying iterator value.

T

Thomas Nelson

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

gmail access 1
python rounding problem. 15
Help with syntax warnings 6
open4 2
Lines of Strings 4
WeBrick 4
May i customize basic operator (such as 1==3)? 5
PHP in instant rails 1

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top