how do i change from string to list
TheDolphin at ivonet.nl
Sun Oct 24 20:16:50 CEST 2004
lst =  # declare the list first
for letter in str:
lst.append(letter) # append to the list
result: ['s', 'p', 'o', 't']
"john" <miodio67 at hotmail.com> wrote in message
news:99ca2e2f.0410241005.39a4f1db at posting.google.com...
> I have the following
> s = "spot"
> which I would like to change to a list
> l = ['s','p','o','t']
> I have tried l = eval(s) but I get the error
> File "<string>", line 1, in ?
> NameError: spot
> thank you all for your time
More information about the Python-list