Which of the following is the correct file mode to read data from a binary…
2026
Which of the following is the correct file mode to read data from a binary file that was created using the pickle module?
Answer: B. rb — The pickle module serializes Python objects into a binary format. To read data from a file created with pickle, you must open the file in binary read mode…
- A.
r
- B.
rb
- C.
rp
- D.
rt
Attempted by 387 students.
Show answer & explanation
Correct answer: B
The pickle module serializes Python objects into a binary format. To read data from a file created with pickle, you must open the file in binary read mode ('rb'). Using text mode ('r') would cause decoding errors because pickle data is not plain text.
Loading lesson…