Is there a simpler way to concatenate string items in a list into a single string? Can I use the str.join() function?
str.join()
E.g. this is the input [\'t
[\'t
We can specify how we have to join the string. Instead of '-', we can use ' '
sentence = ['this','is','a','sentence'] s=(" ".join(sentence)) print(s)