[Chicago] Making a list of strings

Clyde Forrester ccf3 at mindspring.com
Mon Oct 19 20:35:28 CEST 2009

If you wanted to create a list with one element, a string, then perhaps:


instead of


Is that what you are getting at?

Phil Robare wrote:
> OK fellow pythonistas,  can anyone explain what is going on here?
> 	I'm using a recent, but not most recent, version of Python.
> Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)]
> 	I want a list with a string value in it.  I make a sample string to
> put in a list.
> In [1]: s='string'
> 	The obvious way gives me something different but expected
> In [2]: list(s)
> Out[2]: ['s', 't', 'r', 'i', 'n', 'g']

More information about the Chicago mailing list