Computer Science
Which of the following functions is used to write data in the binary mode?
- write
- output
- dump
- send
Python Data Handling
2 Likes
Answer
dump
Reason — To write an object on to a binary file opened in the write mode, we should use dump() function of pickle module as per following syntax: pickle.dump(<object-to-be-written>, <file-handle-of-open-file>)
.
Answered By
2 Likes
Related Questions
The readlines() method returns:
- String
- A list of integers
- A list of single characters
- A list of strings
Which module is required to use the built-in function dump()?
- math
- flush
- pickle
- unpickle
Which is/are the basic I/O (input-output) stream(s) in file?
- Standard Input
- Standard Output
- Standard Errors
- All of these
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()