convert a list to a string?

Tony Meyer t-meyer at ihug.co.nz
Thu Mar 3 22:10:46 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"

" ".join(myList)

=Tony.Meyer




More information about the Python-list mailing list