Given a list, the task is to write a Python program to concatenate all elements in a list into a string.
Input: ['hello', 'geek', 'have', 'a', 'geeky', 'day'] Output: hello geek have a geeky day Input: ['did', 'u', 'like', 'my', 'article', '?'] Output: did u like my article ?
Method 1: Using join() method
hello geek have a 1 day
Method 2: Naive approach
hello geek have a geeky day
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.