CBSE Class 12 Computer Science
Question 36 of 136
Data File Handling — Question 1
Back to all questionsfile1 = open("c:\\test.txt", "r")
Reason — The syntax for 'open()' is: <file variable>/<file object or handle> = open(file_name, access_mode). Therefore, according to this syntax, file1 = open("c:\\test.txt", "r") is the correct statement to open a file for reading. The access mode "r" indicates that the file should be opened in read mode.