Differentiate between file modes r+ and w+ with respect to Python. - Zigya
Advertisement

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


Difference between r+ and w+ is  given below:

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.

74 Views

Advertisement

Exception Handling & Generate Functions

Hope you found this question and answer to be good. Find many more questions on Exception Handling & Generate Functions with answers for your assignments and practice.

Computer Science With Python

Browse through more topics from Computer Science With Python for questions and snapshot.