CBSE Class 12 Computer Science Question 61 of 145

File Handling — Question 22

Back to all questions
22
Question

Question 22

Which of the following functions do you use to write data in the binary format ?

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