Test Index

File Handling in Python Get it on Google PlayDownload on the App Store CBSE Board Videos

© examsnet.com
Question : 27 of 37
Marks: +1, -0
Which of the following mode keeps the file offset position at the end of the file ?
[CBSE 2023 Set 4]
Solution:  
Concept:
The file offset (file pointer) shows where the next read or write will happen.
Explanation:
r and r+: the pointer is at the beginning of the file.
w: the file is emptied and the pointer is at the beginning.
a (append): the pointer is at the end of the file, so new data is added after the existing data.
Answer:
Option D (a)
© examsnet.com
Advertisements
Go to Question: