Computer Science
Which of the following is not a valid mode to open a file ?
- ab
- rw
- r+
- w+
Python File Handling
5 Likes
Answer
rw
Reason — rw is not a valid mode to open file in Python.
Answered By
2 Likes
Related Questions
Which function is used to write a list of strings in a file ?
- writeline()
- writelines()
- writestatement()
- writefullline()
Which of the following represents mode of both writing and reading in binary format in file. ?
- wb+
- w
- wb
- w+
Which of the following mode in file opening statement results or generates an error if the file does not exist ?
- a+
- r+
- w+
- None of these
Which of the following command is used to open a file "c:\pat.txt" in read-mode only ?
- fin = open("c:\pat.txt", "r")
- fin = open("c:\\pat.txt", "r")
- fin = open(file = "c:\pat.txt", "r+")
- fin = open(file = "c:\\pat.txt", "r+")