In Python, what is the technical purpose of the pickle module?
2026
In Python, what is the technical purpose of the pickle module?
- A.
To compress text files to take up less disk space.
- B.
To convert a Python object hierarchy into a byte stream (Serialization) so it can be saved to a file.
- C.
To encrypt sensitive data stored in CSV files.
- D.
To convert Python code into a standalone executable file.
Attempted by 165 students.
Show answer & explanation
Correct answer: B
The pickle module in Python is used for serializing and deserializing object structures. It converts objects into a byte stream (pickling) for storage or transmission and reconstructs them from that stream (unpickling), allowing complex data to be saved while maintaining state.