def unquote(string): """Remove matching pair of single or double quotes around string""" if (string[0] == string[-1]) and string.startswith(("'", '"')): return string[1:-1] return string