how do i change from string to list
lonetwin at gmail.com
Mon Oct 25 10:19:01 CEST 2004
Although you already have the reply to your question, I thought I
should point one thing out. I have seen plenty of newbies wanting to
convert a string to a list so that they can do some sort of list
related manipulation on it. The good thing about python strings though
is, they are valid "sequences", which means that any sequence related
operations can also be carried out on strings.
>>> s = "foobar"
>>> for i in s:
... print i,
f o o b a r
...but I guess you already knew that :)
More information about the Python-list