Is “Read & Write” mode similar to that of “Write & Read” mode?
If yes then why two different modes have been mentioned instead of one?
File Handling In Python
Like in any other programming languages you can open a file in r+, w+ and a+ modes.
r+ opens for reading and writing (no truncating, file pointer at the beginning)
w+ opens for writing (and thus truncates the file) and reading
a+ opens for appending (writing without truncating, only at the end of the file, and the file pointer is at the end of the file) and reading
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.