Tutorials Point


  Python Basics
  Python Advanced
  Python Useful References
  Python Useful Resources
  Selected Reading

© 2011 TutorialsPoint.COM


  Home     References     Discussion Forums     About TP  

Python String join() Method


previous next AddThis Social Bookmark Button


Description:

This method returns a string in which the string elements of sequence have been joined by str separator.

Syntax:

str.join(sequence)

Parameters:

Here is the detail of parameters:

  • sequence: sequence of the elements to be joined.

Return Value:

It returns a string which is the concatenation of the strings in the sequence seq. The separator between elements is the string providing this method.

Example:

#!/usr/bin/python

str = "-";
seq = ("a", "b", "c"); # This is sequence of strings.
print str.join( seq );

This will produce following result:

a-b-c


previous next Printer Friendly



  

Advertisement

Online Image Processing

Indian Baby Names