I want to check whether the given string is single- or double-quoted. If it is single quote I want to convert it to be double quote, else it has to be same double quote.
In my case I needed to print list in json format. This worked for me:
f'''"inputs" : {str(vec).replace("'", '"')},\n'''
Output:
"inputs" : ["Input_Vector0_0_0", "Input_Vector0_0_1"],
Before without replace:
f'"inputs" : {vec},\n' "inputs" : ['Input_Vector0_0_0', 'Input_Vector0_0_1'],