Question 20

Which out of the following mode is required to be used while opening a binary file to allow read as well as write operations in a Python program?

  1. Aab
  2. Bwb
  3. Cr+
  4. Drb+
Show answerHide answer

Correct answer: (D) rb+

Explanation

'rb+' opens an existing binary file for both reading and writing. 'r+' is the text-mode version, and 'wb'/'ab' only write or append.

From DSSSB TGT Computer Science Practice Set 4

This is question 20 of DSSSB TGT Computer Science Practice Set 4. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.