Python Lists – Convert a string in to a list of characters

In this post we will be creating a Python script that will convert an existing string in to a list filled with characters, see below our string for this example.

string="Hello World"

To convert the string in to a list of characters we would use the following code.

List = list(string)
print(List)

The above would return the following as output.

['H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd']
>>> 

Leave a Reply