Amongst which of the following is / are the method of convert Python objects for writing data in a binary file?

72. Amongst which of the following is / are the method of convert Python objects for writing data in a binary file?

  1. set() method
  2. dump() method
  3. load() method
  4. None of the mentioned above

Answer: B) dump() method

Explanation:

The dump() method is used to convert Python objects into binary data that can be written to a binary file. The file into which the data is to be written must be opened in binary write mode before the data can be written. To make use of the dump() method, we can call this function with the parameters data object and file object. There are two objects in this case: data object and file object. The data object object is the object that needs to be dumped to the file with the file handle named file_ object.

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.