With this guide, we will learn how to split a string into a list of characters in Python. Python is a relatively compact language in terms of coding syntax and also supports many methods and libraries to make it easier for programmers to use. So, here are some ways that you can apply to do this.
Split a string into a list of characters in python
Method 1: Using the unpack(*) method
Unpack can only be applied to an object of type iterable. To apply, you need to put the * symbol right in front of that object.
Syntax:
[*[String]]
Parameters:
- String: String you want to split.
Below is the code for this example:
myStr = 'LearnShareIT' print([*myStr])
Unpack helps to separate the string into a list of independent characters, so the Output is a set of characters extracted from the original string.
Output:
['L', 'e', 'a', 'r', 'n', 'S', 'h', 'a', 'r', 'e', 'I', 'T']
A string that we want to split into a completed List of characters as we want.
Method 2: Using list comprehension
With list-comprehension, we can do the above work with just one line of code, and it’s very easy to understand:
Syntax:
[x for x in String]
Parameters:
- String: string you want to split.
See the example below to understand better:
myStr = "LearnShareIT" newList = [x for x in myStr] print(newList)
With this method, your string will be split into separate characters
Output:
['L', 'e', 'a', 'r', 'n', 'S', 'h', 'a', 'r', 'e', 'I', 'T']
Method 3: Using the extend() method
The extend() in Python is a method used to add elements of an iterable (an object containing many elements) such as a list, tuple, or string to a list.
Syntax:
List.extend(string)
Parameters:
- string: string you want to split.
- List: an empty array.
Everything is almost the same as in method 2, and only the primary difference is in syntax. Look at the code below to see that difference.
myStr = 'LearnShareIT' mylist = [] mylist.extend(myStr) print(mylist)
Using an empty array, we can split the string as follows.
Output:
['L', 'e', 'a', 'r', 'n', 'S', 'h', 'a', 'r', 'e', 'I', 'T']
Summary
There are many ways to split a string into a list of characters in Python, with the help of methods and libraries. The above are some of the ways that I think are the most concise and easy to understand that you can apply during your work.
Maybe you are interested:
- Add two lists element-wise in Python
- Remove an element from a list by index in python
- Convert a list of characters into a string in Python

My name is Tom Joseph, and I work as a software engineer. I enjoy programming and passing on my experience. C, C++, JAVA, and Python are my strong programming languages that I can share with everyone. In addition, I have also developed projects using Javascript, html, css.
Job: Developer
Name of the university: UTC
Programming Languages: C, C++, Javascript, JAVA, python, html, css