I have a string:
s= \"[7, 9, 41, [32, 67]]\"
and I need to convert that string into a list:
l= [7, 9, 41, [32, 67]]
why not use eval()?
eval()
>>> s = "[7, 9, 41, [32, 67]]" >>> eval(s) [7, 9, 41, [32, 67]]