3/29/2022

python list string to list

 

.

import ast
x = '[ "A","B","C" , " D"]'
x = ast.literal_eval(x)
>>> x
['A', 'B', 'C', ' D']

.



www.marearts.com