Convert Text to a List in Python
Convert String to a List in Python
In order to convert String to a list in Python, we will use the split() method.
It’s simple:
All we have to do is to specify the delimiter, in this example, the delimiter is “,”
a = "Hello, LearnDuty!"
print(a.split(","))
Output:
['Hello', ' LearnDuty!']