calling is_dir(returns true if the path exists and is directoryor returns false otherwise on my computerhere' what get when try these methods in the interactive shellwindir path(' :/windows'notexistsdir path(' :/this/folder/does/not/exist'calcfile path(' :/windows /system /calc exe'windir exists(true windir is_dir(true notexistsdir exists(false calcfile is_file(true calcfile is_dir(false you can determine whether there is dvd or flash drive currently attached to the computer by checking for it with the exists(method for instanceif wanted to check for flash drive with the volume named :on my windows computeri could do that with the followingddrive path(' :/'ddrive exists(false oopsit looks like forgot to plug in my flash drive the older os path module can accomplish the same task with the os path exists(path)os path isfile(path)and os path isdir(pathfunctionswhich act just like their path function counterparts as of python these functions can accept path objects as well as strings of the file paths the file reading/writing process once you are comfortable working with folders and relative pathsyou'll be able to specify the location of files to read and write the functions covered in the next few sections will apply to plaintext files plaintext files contain only basic text characters and do not include fontsizeor color information text files with the txt extension or python script files with the py extension are examples of plaintext files these can be opened with windows' notepad or macos' textedit application your programs can easily read the contents of plaintext files and treat them as an ordinary string value binary files are all other file typessuch as word processing documentspdfsimagesspreadsheetsand executable programs if you open binary reading and writing files