-4

If I were to get the input of someone and put it into a list. How would I combine this into one big string.

user_input = input()
listed = list(user_input)

I am having trouble with this since the contents are unknown. Is there anyway to make it one big string again(combining all the contents of the list). Is there anything I can import into my code to do this for me

Shaan
  • 13
  • 3

1 Answers1

1

To join a list together, you can use the join method. Simply use it as a method on whatever string you want to have placed between each entry in the list:

>>> ls = ['Hello,','world!']
>>> ' '.join(ls)
'Hello, world!'
dpercy
  • 61
  • 3