Multiple choice

Which of the following file modes opens the file in such a way that all the new data is added to the end of file and we can perform reading operations also?

  1. w

  2. a

  3. a+

  4. +a

  5. w+

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The a+ mode opens a text file for reading and writing both. It creates the file if it does not exist. The reading will start from the beginning but writing can only be appended.