Python String Join() Method
String Join() Method in Python :
The join() method in python is a string method and returns a string in which the elements of a sequence have been joined by a string separator.
Example : list=[1,2,3,4]
string_name: It is the name of string in which joined elements of iterable will be stored.
Return Value: The join() method returns a string concatenated with the elements of iterable.
Type Error: If the iterable contains any non-string values, it raises a TypeError exception.
- Let’s understand with some examples :
Code #1 :