The os.path.exists() function is a built-in function provided by the os module. This function takes the path file and returns 'true' if the file is present. If the file is not present, then the function returns 'false' .
Syntax:
os.path.exists(path)
Parameter:
path: A path-like object signify a file system path. A path-like object is either a string or bytes object signify a path.
Return Type:
This function returns a Boolean value of class bool.It returns True if path exists otherwise returns False.
Comments