input: Write a function to list the contents of a directory. This function should return a list of all files and directories present in the specified directory, including their names and corresponding types (file or directory). If the directory specified does not exist, the function should return None.
  assert list_directory_contents('path/to/existing/directory')==['file.txt', 'directory']
  assert list_directory_contents('path/to/nonexistent/directory')==None
output: import os
  
  def list_directory_contents(directory):
      if not os.path.exists(directory):
          return None
      contents = []
      for item in os.listdir(directory):
          if os.path.isfile(os.path.join(directory, item)):
              contents.append(item)
          elif os.path.isdir(os.path.join(directory, item)):
              contents.append(item)
      return contents