Home >>Python String Methods >Python String join() Method
Python String join() Method in python is used to return a new string which is iterable and joins them into one string by str separator. It is important that a string must be specified as the separator.
Syntax:string.join(iterable)
Parameter | Description |
---|---|
iterable | It is Required where all the returned values are strings |
myjoins = ("Ram", "Vicky", "Shyam")
x = "#".join(myjoins)
print(x)
str = ""
joins1 = ['p','h','p','t','p','o','i','n','t']
str2 = str.join(joins1)
print(str2)