-5

So let's say we have this list

a = ["This", "is", "a", "list"]

How do you transform it into this?

b = ["This is a list"]
wkl
  • 77,184
  • 16
  • 165
  • 176
MaX1M
  • 1
  • 2

3 Answers3

0
a = ["This", "is", "a", "list"]
b = [ ' '.join(a) ]

print(b)

Output:

['This is a list']
little_birdie
  • 5,600
  • 3
  • 23
  • 28
0
b = [" ".join(a)]

" ".join(a) joins all elements of the array with str separator.

0

You have to use join method of string b=[" ".join(a)]