list to string
mack at incise.org
Sat Sep 6 04:16:56 CEST 2003
On Sat, Sep 06, 2003 at 04:06:52AM +0200, Lars Behrens wrote:
> Can someone point me a way to change a list with arbitrary number of
> items to a string :
> vals = ['aaa', 'bbb', 'ccc']
> valstring = 'aaa, bbb, ccc'
> Seems easy at the first glance, but...
>>> vals = ['aaa', 'bbb', 'ccc']
>>> valstring = ", ".join(vals)
'aaa, bbb, ccc'
Nick Welch aka mackstann | mack @ incise.org | http://incise.org
The income tax has made more liars out of the American people than golf
has. Even when you make a tax form out on the level, you don't know
when it's through if you are a crook or a martyr.
-- Will Rogers
More information about the Python-list