Re: modifying iterator value.

2006-04-26 Thread 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 -- http://mail.python.org/mai

Re: modifying iterator value.

2006-04-26 Thread Leif K-Brooks
chun ping wang wrote: > i want to modify an iterator value. > > for x in someList >x = 1 for index, value in enumerate(someList): someList[index] = 1 -- http://mail.python.org/mailman/listinfo/python-list

modifying iterator value.

2006-04-26 Thread chun ping wang
Hi, I have something simple i want to do. i want to modify an iterator value. for x in someList x = 1 is it possible to do that..if not how do i modify a list using iteration. _ Express yourself instantly with MSN Messenger! Do