KnowledgeBoat Logo

Computer Science

Assertion (A): To work with binary files, we need to import pickle module.

Reasoning (R): Pickle module contains two important methods for reading and writing data to binary files, i.e., load() and dump() respectively.

  1. Both A and R are true and R is the correct explanation of A.
  2. Both A and R are true but R is not the correct explanation of A.
  3. A is true but R is false.
  4. A is false but R is true.

Python Data Handling

3 Likes

Answer

Both A and R are true and R is the correct explanation of A.

Explanation
To work with binary files in Python, we indeed need to import the pickle module. The pickle module is used for serializing and deserializing Python objects and contains two important methods, load() and dump(), for reading and writing data to binary files, respectively.

Answered By

2 Likes


Related Questions