CBSE Class 12 Computer Science Question 47 of 136

Data File Handling — Question 12

Back to all questions
12
Question

Question 12

Which of the following functions is used to write data in the binary mode?

  1. write
  2. output
  3. dump
  4. send
Answer

dump

Reason — To write an object on to a binary file opened in the write mode, we should use dump() function of pickle module as per following syntax: pickle.dump(<object-to-be-written>, <file-handle-of-open-file>).