input: Write a function to list the contents of a directory using Python. The function should return a list of strings where each string represents the name of a file or directory in the given directory. If the directory is empty, the function should return an empty list.
  assert list_directory_contents("/home/user/documents")==["file1.txt", "directory1", "file2.txt"]
  assert list_directory_contents("/")==["bin", "boot", "etc", "home"]
  assert list_directory_contents("/nonexistent")==[]
  assert list_directory_contents("/home/user/empty")==[]
output: import os
  
  def list_directory_contents(directory):
      if not os.path.exists(directory):
          return []
      return [name for name in os.listdir(directory) if os.path.isdir(os.path.join(directory, name)) or os.path.isfile(os.path.join(directory, name))]