Class 11 Computer Science Chapter 6 File Handling Quiz 27 (27 MCQs)

Quiz Instructions

Select an option to see the correct answer instantly.

1. How do you close a binary file in Python?
2. Which function is used to open file?
3. If you want to read and write to a file, which mode should you use?
4. How do you serialize and deserialize an object in Java?
5. What will be the output of the program?try { int x = 0; int y = 5 / x; } catch (Exception e) { System.out.println("Exception"); } catch (ArithmeticException ae) { System.out.println(" Arithmetic Exception"); } System.out.println("finished");
6. What is a user-defined function?
7. Explain the concepts of pickling and unpickling in Python file handling.
8. ..... is itself a bunch of bytes stored on some storage device like hard disk, thumb drive etc
9. While working on a group project, Abhishek and Tanisha are reading a CSV file containing data about their survey results. They want to skip the header row to directly access the data. Which of the following is the correct way to use next() to skip the header row while reading the CSV file in Python?
10. What does this code snippet do?with open('numbers.txt', 'r') as f:for line in f:print(line.strip())
11. Structure padding increases:
12. What is the main advantage of using the pathlib module over os.path?
13. Apa kelebihan penggunaan context manager ketika membuka sebuah file?
14. To force python to write the contents of file buffer on to storage file, ..... method may be used.
15. Which Tkinter widget allows users to select one option from a set?
16. Which of the following function can be used to set the file pointer at a given position
17. Which file mode should be used if you need to both read from and write to the same file without deleting its contents?
18. Which of the following function is used to write data in text mode?
19. Which of the following format of files can be created programmatically through Python to some data?
20. Which mode should be used to open a file for appending data in C++?
21. Which of the following codes will close a file named as Sample?
22. Which of the following strings is used to open a file in read as well as write modes?
23. How to import python math modules?
24. A Variable defined inside a function referred to as
25. To store a dictionary in a file in binary format, we use:
26. What is the code to open a file named as Sample and remove all the previous content stored in the file?
27. Explain how to write data to a binary file.