I am just confusing that when I apply:
os.listdir(\"HW-3/data_sets/\")
It works well! and list all the name of files under that directories
A leading slash in a path means an absolute path, or a path that starts at the root of your filesystem. No leading slash makes the path relative to your working directory (typically wherever you launched the script from).
Because of this, the initial slash results in a path that is semantically different from no leading slash, so you should not expect the script to behave the same way for those two paths.