remain open unnecessarily in case we are unable to write in it.
And, there may also be a FileNotFoundError or FileExistsError exception while opening a file. So, we are handling those exceptions also.
In the above program, we are opening a non-existent file in the read mode and trying to write to it. So, the program will print the following output:
File not found








































0 Comments