Why not use the read function when using the w + and a + mode when opening a file in Python? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why not use the read function when using the w + and a + mode when opening a file in Python?

?

19th Nov 2020, 10:01 AM
michael bijirie
michael bijirie - avatar
2 Answers
+ 2
Here default r mode existing
19th Nov 2020, 10:38 AM
Sâñtôsh
Sâñtôsh - avatar
+ 1
Because in a+ and w+ modes are reading the files from the end, while in r and r+ you are reading the files from the start. I don't know why a+ and w+ modes even exist.
19th Nov 2020, 11:00 AM
Seb TheS
Seb TheS - avatar