Advertisements
Advertisements
Question
Assertion (A): For a binary file opened using ‘rb’ mode, the pickle.dump() method will display an error.
Reason (R): The pickle.dump() method is used to read from a binary file.
Options
Both Assertion (A) and Reason (R) are true and Reason (R) is the correct explanation for Assertion (A).
Both Assertion (A) and Reason (R) are true and Reason (R) is not the correct explanation for Assertion (A).
Assertion (A) is true but, Reason (R) is false.
Assertion (A) is false but, Reason (R) is true.
MCQ
Assertion and Reasoning
Advertisements
Solution
Assertion (A) is true but, Reason (R) is false.
Explanation:
pickle.dump() method writes data to a binary file, hence for files opened with “rb” (read binary) Mode the above method will give an error.
shaalaa.com
Is there an error in this question or solution?
