code: def rrmdir(directory):
      
      for root, dirs, files in os.walk(directory, topdown=False):
          for name in files:
              os.remove(os.path.join(root, name))
          for name in dirs:
              os.rmdir(os.path.join(root, name))
      os.rmdir(directory)
docs: Recursivly delete a directory
  
      :param directory: directory to remove