Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

convert string in list format to list python

>>> import ast
>>> x = '[ "A","B","C" , " D"]'
>>> x = ast.literal_eval(x)
>>> x
['A', 'B', 'C', ' D']
>>> x = [n.strip() for n in x]
>>> x
['A', 'B', 'C', 'D']
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #convert #string #list #format #list #python
ADD COMMENT
Topic
Name
8+1 =