l = \"[\'Hello\', \'my\', \'name\', \'is\', \'Apple\']\" l1 = [\'Hello\', \'my\', \'name\', \'is\', \'Apple\']
type(l) returns str>
type(l)
str>
the ast module has a literal_eval that does what you want
ast
literal_eval
import ast l = "['Hello', 'my', 'name', 'is', 'Apple']" l1 = ast.literal_eval(l)
Outputs:
['Hello', 'my', 'name', 'is', 'Apple']
docs