Q:

Remove double quotes from array in python

I have an array as 
col_names = ['"col1"', '"col2"', '"col3"']
I want to remove double quotes from the above using python. So the output should be as 
col_names = ['col1', 'col2', 'col3']
I tried using below but doesn't work. Can you please advise.
for i in col_names: 
    i.strip('"')
    print(i)

for i in col_names: 
    i.replace('"','')
    print(i)

A:

Try this:
col_names = [x[1:-1] for x in col_names]
print(col_names)

Output
['col1', 'col2', 'col3']

Basically, we are taking the substring of every string starting at the second index (1) and ending one before the last index (-1). This way, we omit first and last double quotes(").

