CBSE Class 12 Computer Science
Question 4 of 136
Data File Handling — Question 4
Back to all questions 4
Question 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.
- Both A and R are true and R is the correct explanation of A.
- Both A and R are true but R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
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.