Write a function to Check whether following json is valid or invalid


Topic: Write a function to Check whether following json is valid or invalid

Solution

import json
def validateJSON(jsonData):
    try:
        json.loads(jsonData)
    except ValueError as err:
        return False
    return True



List all Python Programs