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 a file or directory name in the given directory. The function should accept one parameter, which is the path to the directory. If the directory path is not provided, the function should list the contents of the current working directory.
  
  assert list_directory_contents()==['file1.txt', 'dir1', 'file2.txt']
  assert list_directory_contents('/path/to/directory')==['file3.txt', 'dir2']
  assert list_directory_contents('/nonexistent/path')==[]
  assert list_directory_contents('')==['file4.txt', 'dir3']
output: import os
  
  def list_directory_contents(path=None):
      if path is None:
          path = os.getcwd()
      if not os.path.exists(path):
          return []
      return os.listdir(path)