File Handling in Python · Class 12 · CBSE · Science Computer Science

Which file mode opens a text file for writing by adding new data at the end without deleting its existing contents?

Practice question from File Handling in Python (Class 12 · CBSE · Science Computer Science), with the correct answer and a step-by-step solution.

easy · MCQ · Q-1625A6

Which file mode opens a text file for writing by adding new data at the end without deleting its existing contents?

  1. A.r
  2. B.aCorrect answer
  3. C.w
  4. D.r+

Solution

The a mode opens a file for appending. New data is written at the end, and the existing contents are preserved.

More from File Handling in Python

All of File Handling in Python

Practise more Computer Science

Sign up free for adaptive practice on this chapter, with instant feedback and hints on every question.

Start practising free

Free to start · No credit card needed