.join() method concatenates all items from an iterable into a single string.
.join() method is called on a
separatorcan be any string, even an empty one, and is placed between each element from the
iterableis any object that can be iterated over like tuples or lists. All values of the
iterablemust be strings.
The following example returns a string version of the
fruits list, separated by a single space (
fruits = ["Apples", "Bananas", "Blueberries"]combined = " ".join(fruits)print(combined)# Output: Apples Bananas Blueberries
.join() to append elements of a tuple with a dash (
"-") as a separator: