# define a list
my_list = ['D', 'e', 'v', 's', 'h', 'e', 'e', 't']
# use join() function to convert list to string
result = "".join(my_list)
print(result)
Output
Devsheet
If you do not want to use any method to convert a List to String, you can also use Python For loop. We will be applying for loop on the list and in each iteration, we will append the item to String variable result.
my_list = ['D', 'e', 'v', 's', 'h', 'e', 'e', 't']
result = ''
for item in my_list:
result += item
print(result)
Output
Devsheet
words = ["Hello", "World"]
result = " ".join(words)
print(result)
# -> Hello World
0 Comments