Question 124Asked in DSSSB TGT Computer Science, 7 Feb 2024, Shift 2 (12:30 PM)

In Python language, which of following mode for opening the file, opens the file for

In Python language, which of following mode for opening the file, opens the file for both reading and writing and file pointer will be placed at the start of the file?
  1. Aab
  2. Brb
  3. Cr⁺
  4. Da⁺
Show answerHide answer

Correct answer: (C) r⁺

Explanation

"r+" opens a file for reading and writing with the file pointer at the beginning. "a+" places it at the end; "rb" is read-only and "ab" append-only.

From DSSSB TGT Computer Science PYQ, 7 Feb 2024, Shift 2 (12:30 PM)

This is question 124 of DSSSB TGT Computer Science PYQ, 7 Feb 2024, Shift 2 (12:30 PM). 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.