input: Write a function to modify the provided Python code to handle errors, specifically catching `FileNotFoundError` when the specified file does not exist and `json.decoder.JSONDecodeError` when the file is not in a valid JSON format. The function should print appropriate error messages and return `None` if an error occurs.
  
  
  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.")
          return None
      except json.decoder.JSONDecodeError:
          print("The file specified is not in a valid JSON format.")
          return None
  
  
  assert read_data_from_json("nonexistent_file.json")==None
  assert read_data_from_json("invalid_format.json")==None
  assert read_data_from_json("valid_file.json")=={"key": "value"}
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.")
          return None
      except json.decoder.JSONDecodeError:
          print("The file specified is not in a valid JSON format.")
          return None