Bernard Lebel wrote:
> Hello,
> 
> The documentation says that the built-in join method now replaces the
> string.joinfield function.  However how do you achieve the same
> operation? The join method accepts only one argument, that is, the
> list of strings to join. How do you then specify the separating
> character?

join() is a method of a string object. The string you invoke it on is the 
separating character. It may seem a bit strange but it works:

 >>> l=['hello', 'world', 'how are you?']
 >>> ', '.join(l)
'hello, world, how are you?'

Kent

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to