def print_value(v):
    """double quote v if v is a string, return str(v) otherwise"""
    if isinstance(v, str):
        quoted = v.replace('"', r'\"')
        return f'"{quoted}"'
    else:
        return str(v)