Join strings - very simple Q.
Dustan
DustanGroups at gmail.com
Sat Mar 24 07:59:47 EDT 2007
On Mar 23, 1:30 pm, Paulo da Silva <psdasil... at esotericaX.ptX> wrote:
> Mike Kent escreveu:
> ...
>
> > New way:
> > l=['a','b','c']
> > jl=','.join(l)
>
> I thank you all.
>
> Almost there ...
> I tried "".join(l,',') but no success ... :-(
>
> Paulo
Perhaps you're doing it wrong, despite having an example right in
front of you?
Side by side comparison:
jl=string.join(l,',')
jl=','.join(l)
The sequence is passed as an argument to the join method, and the
delimiter is the string whose method is being called.
More information about the Python-list
mailing list