-2

How can I make a word from all the letters in a string?

For example: (this is my list)

["h","e","l","l","o"]

And I want this as output:

hello

BOB
  • 59
  • 2
  • 8

3 Answers3

3

Try this :

"".join(["h","e","l","l","o"])
Arkistarvh Kltzuonstev
  • 6,824
  • 7
  • 26
  • 56
3

Use the join function which concatenate all the characters/substrings present in the list & return a single string.

name = ["h","e","l","l","o"]
concat_name = "".join(name)
print(concat_name)

Output :

hello
Usman
  • 1,983
  • 15
  • 28
2

Try this :

''.join(["h","e","l","l","o"])
DivideBy0
  • 85
  • 2