On Mon, 21 Mar 2005 11:57:21 +, Matt Williams
<[EMAIL PROTECTED]> wrote:
> Dear List,
>
> Thanks for the help with the previous problem - now all solved!
>
> I have a question about accessing lists. I'm trying to do something to
> each item in a list, and then assign it back into the list, ov
On Mar 21, 2005, at 12:57, Matt Williams wrote:
for i in range(len(y)):
y[i]="z"
print y
Surely there must be a better way than this ?
Sounds like a job for... list comprehensions! (cue cheesy superhero
music)
y = ["z" for i in y]
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look
Dear List,
Thanks for the help with the previous problem - now all solved!
I have a question about accessing lists. I'm trying to do something to
each item in a list, and then assign it back into the list, overwriting
the old value. However, the first loop here doesn't work, whereas the
second lo