CBSE Class 12 Computer Science Question 4 of 145

File Handling — Question 4

Back to all questions
4
Question

Question 4

Assertion. 'Pickling' is the process whereby a Python object hierarchy is converted into a byte-stream.

Reason. 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

A binary file works with byte-streams and 'Pickling' is the process in binary file, where a Python object hierarchy is converted into a byte-stream. Binary files are commonly used as the destination for pickled data. This is because binary files can efficiently store raw binary data, including the byte-streams produced by pickling.