I have a list with below pattern and i want to get rid of \" which is present at the beginning and end of each sub list. I tried replace, strip but they are not the
\"
You can use shlex.split after removing commas with replace:
replace
import shlex lst = [["'123', 'Name1', 'Status1'"], ["'234', 'Name2', 'Status2'"]] r = [shlex.split(x[0].replace(',', '')) for x in lst] # [['123', 'Name1', 'Status1'], ['234', 'Name2', 'Status2']]