Aspire's Library

A Place for Latest Exam wise Questions, Videos, Previous Year Papers,
Study Stuff for MCA Examinations - NIMCET

Previous Year Question (PYQs)



What is the correct file mode that opens preexisting file in read and write mode?





Solution

Solution: - `"r+b"` or `"rb+"` → open **existing file** for both reading and writing (no truncation). - `"w+b"` or `"wb+"` → open file for reading and writing but **creates/truncates** file. - `"ab"` → append binary mode. Hence, the correct mode for **existing file in read-write** is `"r+b"`.


Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More


Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More

Ask Your Question or Put Your Review.

loading...