Function Details: join

Description


Return a string which is the concatenation of the strings in iterable.


Extended Description


The join() method concatenates all the strings in the given iterable, using the string on which the method is called as a separator between each item. This method is often used to efficiently concatenate a large number of strings. The iterable must contain only string objects, or TypeError will be raised.


Read More about join from Python Documentation

Function Signature



Module: builtins

Class: str

Parameters



Parameter List


  • iterable: Iterable[str]

Return


Returns a new string which is the concatenation of the strings in the iterable, separated by the string on which the method was called.


Return Type


str

Output

Explanation

This example demonstrates the basic usage of join(). It joins the list of strings using '-' as the separator.