input: Write a function to modify the given Python code to handle errors such as FileNotFoundError and JSONDecodeError. If the file specified does not exist, print "The file specified does not exist." If the file is not in a valid JSON format, print "The file specified is not in a valid JSON format." The original function attempts to read data from a JSON file and return it.
  
  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("nonexistent_file.json") == None
  assert "The file specified does not exist." in captured_output.getvalue()
  assert read_data_from_json("invalid_json_file.json") == None
  assert "The file specified is not in a valid JSON format." in captured_output.getvalue()
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.")