Q. Differentiate between file modes r+ and w+ with respect to python.


Answer =

• r+ opens a file for both reading and writing. The file pointer placed at the beginning of the file.

• w+ opens a file for both writing and reading. Overwrites the existing file if the file exists. If the file does not exist, creates a new file for reading and writing.

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post