input: Write a function to modify a Python function that reads data from a JSON file and handle errors gracefully. If the specified file does not exist, print a message indicating that the file does not exist. If the file is not in a valid JSON format, print a message indicating that the file is not in a valid JSON format.
  
  def read_data_from_json(filename):
      try:
          with open(filename, 'r') as f:
              data = json.load(f)
          return data
      except FileNotFoundError:
          print("The file specified does not exist.")
      except json.decoder.JSONDecodeError:
          print("The file specified is not in a valid JSON format.")
  
  assert read_data_from_json("nonexistentfile.json")=="The file specified does not exist."
  assert read_data_from_json("invalidformat.json")=="The file specified is not in a valid JSON format."
output: def read_data_from_json(filename):
      try:
          with open(filename, 'r') as f:
              data = json.load(f)
          return data
      except FileNotFoundError:
          print("The file specified does not exist.")
      except json.decoder.JSONDecodeError:
          print("The file specified is not in a valid JSON format.")