Solved

You Are Running a Python Script That Is Supposed to Write

Question 48

Multiple Choice

You are running a Python script that is supposed to write data to an open file, but discover that the file contents are being erased each time the script runs. What is most likely the issue?


A) The file was opened using a mode string other than 'a'.
B) The file is truncated by default with the write() method.
C) The file is erased when the script uses the close() method.
D) The file must be opened using a mode string of 'rw'.

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents