Concatenate list values
alister
alister.nospam.ware at ntlworld.com
Mon Feb 23 11:08:31 EST 2015
On Mon, 23 Feb 2015 07:58:39 -0800, loial wrote:
> Is there a quick way to concatenate all the values in a list into a
> string, except the first value?
>
> I want this to work with variable length lists.
>
> All values in list will be strings.
>
> Any help appreciated
''.join(mylist[1:])
all elements must be strings (as specified) or it will cause an error
--
petribar:
Any sun-bleached prehistoric candy that has been sitting in
the window of a vending machine too long.
-- Rich Hall, "Sniglets"
More information about the Python-list
mailing list