How can I change the data type from string to list and also remove the single qoutes outside?
x = '["a","b"]'
type(x)
>>> str
Desired output is
x = ["a","b"]
type(x)
>>> list
>Solution :
The string you have is valid json, so you can just parse it:
import json
x = '["a","b"]'
l = json.loads(x)
print(l)
# ['a', 'b']
print(type(l))
# <class 'list'>