join Examples
The general syntax for this method is:
'connecter'.join(list_name)join combines all of the elements in list_name into a single string.
Note that each element in list_name MUST be a string data type.
The 'connector' determines the string that “glues” the list elements
together. 'connector' may be the empty string (''), any single
character, multiple characters, or special characters (like '\t' or
'\n').
Example
| |
Output
1+2+3+4
HelloWorld!
Hello
World
!