Python | os.listdir() method - GeeksforGeeks
www.geeksforgeeks.org › python-os-listdir-methodMay 17, 2019 · If we don’t specify any directory, then list of files and directories in the current working directory will be returned. Syntax: os.listdir(path) Parameters: path (optional) : path of the directory. Return Type: This method returns the list of all files and directories in the specified path. The return type of this method is list. Code #1: use of os.listdir() method