I am trying to convert the following string of a list back to a list.
[('zX7XjZ1Vwai5UbqNDDJ1NQ', 570512, [155])] I have tried both eval() and ast.literal_eval but for some reason when I print the type of my converted string it is still a string (but with the quotations removed)
I have also tried using json.loads()
It seems like no matter how hard I try, I cannot convert this string of a list to a python list!
evalworked for me. what version of python do you have?tupleelement that containsstringandintandlist.ast.literal_eval("[('zX7XjZ1Vwai5UbqNDDJ1NQ', 570512, [155])]") == [('zX7XjZ1Vwai5UbqNDDJ1NQ', 570512, [155])]returnsTrue.eval("[('zX7XjZ1Vwai5UbqNDDJ1NQ', 570512, [155])]")gives[('zX7XjZ1Vwai5UbqNDDJ1NQ', 570512, [155])]typeon result?