Answer
os.filePath.isfile(fileName) function is used to test if a filename exists, it returns True if file with fileName exists.
os.filePath.getsize(filename) function is used to test if a filename exists, it returns the size of the file.
os.listdir(directory) function is used to return all subdirectories and files under the directory.
Work Step by Step
No explanation required.