QUESTION IMAGE
Question
question # 1 multiple choice which statement opens a text file so that you can retrieve the information it contains? afile = open(\books.txt\,
\) afile = open(\books.txt\,\s\) afile = open(\books.txt\,\w\) afile = open(\books.txt\,\a\)
In Python, the "r" mode in the open() function is used for reading a text - file. The "s" mode is not a valid mode for the open() function. The "w" mode is for writing (it will overwrite the existing file or create a new one), and the "a" mode is for appending to an existing file.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
A. aFile = open("books.txt","r")