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

Quiz Instructions

Select an option to see the correct answer instantly.

1. The first and second arguments of fopen() are
2. A text file has the file extension of:
3. Select the correct order for processing a file.
4. Why is a good idea to store data in text files?
5. Why is it important to always close files after handling them in PHP?
6. What does the 'r' mode signify when opening a file using fopen()?
7. Apa arti ios::in saat membuka file?
8. In what scenarios would you use the Dump function in Python?
9. What is the best way to read an entire file into a list of strings?
10. How do you CALL the function name in Python?
11. What does the "t" mode specify when opening a file in Python?
12. How does the OCR Exam Reference Language handle file opening compared to Python?
13. Which method is used to write a string to a file in Python?
14. What does rewind() do?
15. What is the purpose of the getc() function in C?
16. Explain the concept of thrashing in virtual memory.
17. To read the remaining line of the file from a file object called F ..... H, we use
18. Explain the concept of appending to a file in Python.
19. Which of these will raise an error if file already exists?
20. File can be added to. File is created if it doesn't already exist.
21. What is the significance of the 'encoding' parameter in file handling?
22. In the pseudocode provided, what is the function used to open a file?
23. This method returns the number of characters written to the file.
24. The content of a file "sample.txt" are shown below:1, 2, 3, 4'a', 'b', 'c'5, 23, 'me', 'peace" to', 'be', 'or' 'not'
25. What is the code to open a file named as Old ..... Data for writing data to it?
26. Which method checks if a file is closed?
27. What does seek(5) do in a file?
28. How can you read a CSV file using Python's built-in libraries?
29. What will file.read(4) do?
30. Function to read the entire file
31. To read the entire contents of the file as a string from a file object fobj, the command should be:
32. What will happen when you run this code:with open('data.txt', 'r') as file:print(file.read())?
33. Which of these class contains the methods print() & println()?
34. What is missing from this code?file = open ( "test1 ..... ", "w" )
35. If break statement is inside a nested loop, break will terminate the innermost loop.
36. Class Main { public static void main(String args[]) { try { throw 10; } catch(int e) { System.out.println("Got the Exception '' + e); } }}
37. Assume that the customer file references a file object, and the file was opened using the 'w' mode specifier. How would you write the string 'Mary Smith' to the file?
38. Every file maintains a ..... which tells the current position in the file.
39. Which mode should be used with pickle.load()?
40. What does the "t" in the mode "rt" stand for when opening a file in Python?
41. What is the purpose of a pointer FILE* in C?
42. To create the reader object, the correct syntax is ..... [Assume that the salesdet.csv file is opened in reading mode in the file handle fh.
43. What does the pathlib module do?
44. What are file extensions?
45. What does the 'seekg' function do in file handling?
46. What is the function of the mode ' w+'?
47. Which mode in Python is used to open a file for writing?
48. CSV module allows writing multiple records in a CSV file using
49. Which statement correctly opens a file for exclusive creation?
50. Given a text file opened as file ..... in, which of the following will print the entire file?
51. When you open a file for reading and if the file does not exist what occurs?
52. What is the purpose of debugging?
53. The command file.closed returns:
54. What happens if you try to read past the end of a file?
55. A class which is used for reading information from data files is called
56. Python deals with ..... different types of a file.
57. What is the purpose of the 'shelve' module?
58. What does the program that checks for end of file do?
59. The best mode to store a structure is:
60. When a program reads a file, it enters every character into memory as a tuple