Which of the following is NOT one of the four modes for opening a file in Python, using the open() function?

"r" (read)

"a" (append)

"d" (delete)

"w" (write)

1 answer

The mode that is NOT one of the four modes for opening a file in Python using the open() function is "d" (delete).

The valid modes are:

  • "r" for reading
  • "a" for appending
  • "w" for writing

There is no mode "d" for deleting files in the open() function. To delete a file, you would use the os.remove() function from the os module.

Similar Questions
    1. answers icon 1 answer
  1. Why might you need to convert a file to another file type?A. It is a music or image file. B. The file is old. C. The file uses a
    1. answers icon 9 answers
  2. What does a file extension tell you?A. what the file is about******* B. where the file is located C. what type of file it is D.
    1. answers icon 11 answers
    1. answers icon 1 answer
more similar questions