I have a string such as thislist = "[3, 2, 1]"
or "[1]"
I need to convert it to a list with float (or int) elements, but i don't know how to do it?
What i tried is this:
thislist = list(thislist)
But, when i try this solution, it gives me:
['[', '3', ',', ' ', '2', ',', ' ', '1', ']']
which is not what i need. Of course, i can do some more process to obtain my favorite result which is
[3,2,1]
. But, i am looking for the most efficient approach!