convert a list to a string?

Anthony Liu antonyliu2002 at yahoo.com
Thu Mar 3 22:09:08 EST 2005


Suppose I have a list 

myList = ["this", "is", "a", "sample", "list"]

If I don't want to iterate through it and concatenate
the list elements, how do I easily convert it to a
string like

"this is a sample list"

str(myList) will only give you things like

"["this", "is", "a", "sample", "list"]"

That is not what I want.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the Python-list mailing list