- Home
- Class - 12 CBSE Computer Science — Assertion Reason Type Questions
Assertion. 'Pickling' is the process
Class - 12 CBSE Computer Science — Assertion Reason Type Questions
Assertion. 'Pickling' is the process whereby a Python object hierarchy is converted into a byte-stream.
Reason. Pickling process is used to work with binary files as a binary file works with byte-streams.
Answer
(b)
Both Assertion and Reason are true but Reason is not the correct explanation of Assertion.
Explanation
"Pickling" is the process whereby a Python object hierarchy is converted into a byte-stream. Pickling process is used to work with binary files as a binary file works with byte-streams. This is because binary files can efficiently store raw binary data, including the byte-streams produced by pickling. The use of binary files is just one of the many possible applications of pickling, but not the primary reason for its existence.