DEV Community

Ahmad
Ahmad

Posted on

Answer: How to convert array string to an array in python [duplicate]

You can use ast.literal_eval

>>> from ast import literal_eval
>>> s = "['a',['b','c','d'],'e']"
>>> print(literal_eval(s))
['a', ['b', 'c', 'd'], 'e']

Top comments (0)