Here’s a 15-question “Binary File Quiz Class 12” based on the topic “Binary file: basic operations on a binary file: open using file open modes (rb, rb+, wb, wb+, ab, ab+), close a binary file, import pickle module, dump() and load() method, read, write/create, search, append and update operations in a binary file”

Binary File Quiz Class 12

1. How do you open a binary file for reading in Python?

 
 
 
 

2. Which open mode allows both reading and writing in a binary file without truncating the file?

 
 
 
 

3. What is the purpose of the pickle module in Python when working with binary files?

 
 
 
 

4. How can you close an open binary file in Python?

 
 
 
 

5. Which method of the pickle module is used to write Python objects to a binary file?

 
 
 
 

6. In the context of binary files, what does the rb open mode signify?

 
 
 
 

7. What does the wb+ open mode do when opening a binary file?

 
 
 
 

8. Which method is used to read data from a binary file in Python?

 
 
 
 

9. What does the load() method of the pickle module do?

 
 
 
 

10. How can you write binary data to a file using the wb mode?

 
 
 
 

11. What operation does the ab open mode perform when opening a binary file?

 
 
 
 

12. In the context of binary files, what does the wb open mode signify?

 
 
 
 

13. What is the purpose of the dump() method of the pickle module?

 
 
 
 

14. How can you update data in a specific position within a binary file?

 
 
 
 

15. Which method is used to append data to the end of a binary file in Python?

 
 
 
 

Copywrite © 2020-2024, CBSE Python,
All Rights Reserved