"C M Caine" <[email protected]> wrote
My intention now is to modify list contents in the following fashion:
for index, value in enumerate(L):
L[0] = some_func(value)
I think you mean:
L[index] = some_func(value)
Is this the standard method?
Or use a List copmprehension.
L = [some_func(value) for value in L]
I'd say nowadays that the comprehension was most common.
--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor