input: Write a function to handle errors when reading data from a JSON file. If the file 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." Ensure the function returns the data if the file is read successfully.
  
  
  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") == None
  assert read_data_from_json("corruptfile.json") == None
  assert read_data_from_json("validfile.json") != None
  
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.")