input: Write a function to list the contents of a directory given its path. If the path is not provided, list the contents of the current directory. Return the list of contents as a Python list.
  assert list_contents("C:/Users/User1/Documents")==["file1.txt", "file2.txt", "folder1"]
  assert list_contents("C:/NoSuchFolder")==[]
  assert list_contents()==["main.py", ".vscode", "data.csv"]
output: import os
  
  def list_contents(path=None):
      if path is None:
          path = os.getcwd()
      if not os.path.exists(path):
          return []
      return os.listdir(path)