Use ast
and then ast.literal_eval()
import ast
print(ast.literal_eval(x))
solved Turn a string of a list to an integer in Python [closed]
Use ast
and then ast.literal_eval()
import ast
print(ast.literal_eval(x))
solved Turn a string of a list to an integer in Python [closed]