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.
Sounds like you are working with JSON. I would just make sure it is always a double quoted like this:
doubleQString = "{0}".format('my normal string')
with open('sampledict.json','w') as f:
json.dump(doubleQString ,f)
Notice I'm using dump, not dumps.
Sampledict.json will look like this:
"my normal string"