input: Write a function to parse a json-formatted string into a dictionary.
  
  def json_to_dict(data):
      return json.loads(data)
  
  assert json_to_dict('{"name": "John","age": 30,"address": {"city": "New York","state": "NY"}}')=={"name": "John","age": 30,"address": {"city": "New York","state": "NY"}}
  assert json_to_dict('{"fruit": "apple","color": "red"}')=={"fruit": "apple","color": "red"}
  assert json_to_dict('{"book": "Moby Dick","author": "Herman Melville"}')=={"book": "Moby Dick","author": "Herman Melville"}
  assert json_to_dict('[]')==[]
  assert json_to_dict('123')==123
output: def json_to_dict(data):
      return json.loads(data)