Computer Science
The difference between r+ and w+ modes is expressed as?
- No difference
- In r+ mode, the pointer is initially placed at the beginning of the file and the pointer is at the end for w+
- In w+ mode, the pointer is initially placed at the beginning of the file and the pointer is at the end for r+
- Depends on the operating system
Answer
In r+ mode, the pointer is initially placed at the beginning of the file and the pointer is at the end for w+
Reason — In 'r+' mode (read and write), the pointer is initially placed at the beginning of the file. In 'w+' mode (read and write), the pointer is placed at the end of the file.
Related Questions
Which of the following is not a valid mode to open a file ?
- ab
- rw
- r+
- w+
Which statement is used to change the file position to an offset value from the start?
- fp.seek(offset, 0)
- fp.seek(offset, 1)
- fp.seek(offset, 2)
- None of these
What does CSV stand for?
- Cursor Separated Variables
- Comma Separated Values
- Cursor Separated Values
- Cursor Separated Version
Which module is used for working with CSV files in Python?
- random
- statistics
- csv
- math