W3docs

How to convert list to string

You can use the join() method to convert a list of strings to a single string.

You can use the join() method to convert a list of strings to a single string. The join() method takes one parameter, which is the delimiter that separates the elements of the list in the resulting string. Here's an example:

Join a list's elements to create a string in Python

python— editable, runs on the server
Info

Watch a video course: Python - The Practical Guide

In this example, the delimiter is a space character, so the resulting string will have a space between the words "Hello" and "world". You can use any delimiter you want, including an empty string to join the list elements without any delimiter.