Computer Science
Which of the following is the correct syntax of file object 'fobj' to write sequence data type using writelines() function?
- file.writelines(sequence)
- fobj.writelines()
- fobj.writelines(sequence)
- fobj.writeline()
Python Data Handling
1 Like
Answer
fobj.writelines(sequence)
Reason — The syntax for a file object to write sequence data using the writelines() function is fileobject.writelines(sequence)
. Therefore, fobj.writelines(sequence)
is correct.
Answered By
1 Like
Related Questions
Which of the following functions is used to write data in the binary mode?
- write
- output
- dump
- send
Which is/are the basic I/O (input-output) stream(s) in file?
- Standard Input
- Standard Output
- Standard Errors
- All of these
In file handling, what do the terms "r" and "a" stand for?
- read, append
- append, read
- write, append
- None of these
Which of the following is not a valid mode to open a file ?
- ab
- rw
- r+
- w+