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

Quiz Instructions

Select an option to see the correct answer instantly.

1. The correct syntax of the len function for string x:
2. The correct syntax to close the file (name of file handle F)
3. In order to work with a pickle mode you must first import
4. Delimeter for CSV file is
5. Choose the correct syntax of the replace function:
6. What does the 'r' mode do when opening a file?
7. What is the purpose of the rewind() function?
8. Inorder to avoid conflicts what concept is used in files
9. To create a csv file sales.csv, the correct syntax is .....
10. How do you ensure that a file is properly closed after operations?
11. Which logical operator used to check for any one condition to be true?
12. Fwrite() is used to write:
13. How do you write data to a binary file in Python?
14. Which of the following options is the correct Python statement to read and displaythe first 10 characters of a text file "poem.txt" ?
15. Files being used by programs are copied into main memory
16. Which function is used to write all the charecters
17. What is the use of "a" in file handling?
18. Which Python library is commonly used for GUI programming involving widgets like Label and Button?
19. How do you read the entire content of a file in Python?
20. Why is it important to close a file in Python?
21. CSV stands for .....
22. Which of the following is NOT a basic file handling operation?
23. The ..... function changes the position of the file pointer by placing the file pointer at the specified position in an open file
24. What is the difference between text and binary files?
25. Which mode is correct for writing binary file?
26. Which mode is used to open a binary file for writing?
27. Fread() reads contents of file
28. How do you read a file line by line in Python?
29. How do you handle exceptions while working with Fileinputstream and Fileoutputstream in Java?
30. Describe how to serialize an object in Python.
31. Ali opens a file with mode "r" . He tries to write new data into it, but an error occurs. Why?
32. Dalam C++, fungsi mana yang digunakan untuk membuka file?
33. Using append overwrites all data in a text file
34. Which function is used to read a single line from a file
35. What is the code to open a file named as new ..... file in write mode and truncate it if it already exists?
36. What are the different modes of opening a file in C++?
37. What does the tell() function return in Python file handling?
38. In Python, which function do you use to open a file?
39. What is the purpose of closing a file after it is no longer being used?
40. Which exception is thrown when divide by zero occurs?
41. How do you close a file after performing file operations in C++?
42. What will be the output of the following code snippet?f = Nonefor i in range (5):with open("myfile.txt", "w") as f:if i > 2:breakprint (f.closed)
43. What is the result of trying to access an index that is out of range in a list?
44. Which of the following class is used for input and output operation when working with characters?
45. How is Java serialization achieved?
46. What is the purpose of the 'close' method in file handling?
47. Which is/are the basic I/O (input-output) stream(s) in file?
48. Why is Binary File Handling important in Python programming?
49. How can you handle exceptions when working with binary files?
50. What is the purpose of using a list for records in Python?
51. Which function is used to write a list of Strings in a file?
52. Explain the difference between read() and readline() in Python file handling.
53. Why is it important to close a file after operations are completed?
54. In binary file, there is no delimiter for a line.
55. In pseudocode, how do you append data to a file?
56. Reading from a file often involves using .....
57. Which of the following is used to open a file in read mode?
58. To read 2 characters from a file object fobj, the command should be:
59. Discuss the different modes used for opening a file in Python.
60. Which mode should be specified in the 'open()' function when you need to write to a file?