Input: ['g',' e', 'e',' k', 's',' f', 'o',' r', 'g' , 'e',' e', 'k',' s'] Output: pythonengineering Input: ['p',' r', 'o',' g', 'r',' a', 'm' , 'm',' i', 'n',' g'] Output: programming
Method 1: traversing the list
Initialize an empty string at the beginning. Loop through the list of characters, for each index add a character to the original string. When the traversal is complete, print the line that was added with each character.
Method 2. Using the join () function
Using the function isalnum-isspace-join/> join () in python, it is possible to concatenate all characters in a list. Syntax:
str = "" str1 = ("geeks", "for", "geeks") str.join (str1)
List of symbols can be easily concatenated by initializing str = ”” so that there are no spaces between them.