Convert a Delimited String to a List in Python
Let’s say you have a string with values that are delimited by a comma. This would be common when parsing text files.
So suppose you have a delimited string:
x = "abc,def,ghi"
You can convert that into a Python list using the split function, passing the character that is delimiting the items:
y = x.split(",")
print y // [’abc’, ‘def’, [...] Read more »