-2

say you have a list like so:

lst = ['my', 'name', 'is', 'jack.']

If I convert to a string doing this:

''.join(lst)

output

'mynameisjack.'

How do I make the list print out:

 "my name is jack."

instead of all together.

gilbo184
  • 89
  • 1
  • 8

1 Answers1

0

Instead of using ''.join(lst)(an empty string), use ' '.join(lst), with a space (see the documentation of join!).

Matthieu Brucher
  • 21,634
  • 7
  • 38
  • 62