input: Write a function to modify the following Python code to handle errors. The function should implement exception handling for FileNotFoundError and json.decoder.JSONDecodeError, and print appropriate error messages when these errors occur. If the file is successfully read and contains valid JSON data, it should return the data.
  assert read_data_from_json("existing_file.json")=={"key":"value"}
  assert read_data_from_json("nonexistent_file.json")==None
  assert read_data_from_json("invalid_json_file.json")==None
  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.")
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.")