How to validate a JSON file using Python?
Asked in the round 1 stage. Implement a strict validator for JSON content supplied as a string.
Implement validate_json(content), returning True only when content is valid standard JSON. Reject malformed syntax, duplicate keys within an object, and non-standard constants such as NaN or Infinity. Return False otherwise.
Examples: '{"name":"TCS","active":true}' returns True; '{"id":1,"id":2}' returns False; '[1, 2,' returns False.
def validate_json(content):