how do i change from string to list
Ivo Woltring
TheDolphin at ivonet.nl
Sun Oct 24 17:21:25 EDT 2004
More information about the Python-list mailing list
Sun Oct 24 17:21:25 EDT 2004
- Previous message (by thread): how do i change from string to list
- Next message (by thread): how do i change from string to list
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I agree completely! Didn't know the list() though. But all work so my answer is just as valid as yours ;-)) Ivo "Ivo Woltring" <TheDolphin at ivonet.nl> wrote in message news:417bf196$0$771$3a628fcd at reader20.nntp.hccnet.nl... > str='spot' > > lst = [] # declare the list first > for letter in str: > lst.append(letter) # append to the list > > print lst > > result: ['s', 'p', 'o', 't'] > > cheerz, > Ivo. > > > "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 > >
- Previous message (by thread): how do i change from string to list
- Next message (by thread): how do i change from string to list
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list