Skip to main contentSkip to solution

The pickle module provides two methods to work with binary files. They are:

A. load()

B. unload()

C. dump()

D. clean()

Solution

✅ Correct Option: 2

The pickle module's two methods for binary files are dump()dump() and load()load(). dump()dump() writes (serialises) a Python object into a binary file, and load()load() reads it back (deserialises).

The file must be opened in binary mode, for example "wb" for dump()dump() and "rb" for load()load().


B and D: unload()unload() and clean()clean() do not exist in the pickle module.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question