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

Quiz Instructions

Select an option to see the correct answer instantly.

1. What is the file extension for CSV files?
2. ..... is a location to store permanently (Secondary)in a system for future use
3. Yashi wants to check whether her name is listed in Shortlisted.dat or not. Which command she can write to open the file:
4. What function is used to read a text file in Python?
5. Which of the following represents mode of both writing and reading in binary format in file?
6. True or False:One way you could use a csv file is to add new units/floorplans to a building
7. Which section in the content includes "Random accessing files" ?
8. In seek()-mode 0 will indicate.
9. What is the process of reading data from a text file called?
10. What type of data does read() return?
11. Which of the following prints contents of a file line by line?
12. What will happen if you try to open an existing file in 'x' mode?
13. The type of file doesn't require translation or specific encoding
14. When you try to open a non existing file then
15. Provide an example of an Absolute Path in file handling.
16. What does the following code do?f = open('file.txt', 'r')lines = f.readlines()f.close()
17. What does the readfile() function do in PHP?
18. Which type of file stores data in binary format?
19. What is the topic that we discussed?
20. What happens if no arguments are passed to the seek () method?
21. What is the purpose of closing a file after using it?
22. What happens if you try to read from a file that does not exist?
23. How can a program read an entire line from a text file?
24. What does the os.path.basename() function return?
25. The readlines() returns
26. A pre-defined function is known as
27. This method returns a list where the text between the specified separator becomes the list items.
28. Which of the following is NOT a function mentioned in the literacy section?
29. What is the significance of the 'Boolean variable' in the Python file handling examples?
30. What does the csv.writerow() function do?
31. What is the file mode 'r' in Python
32. What will file.read() return?
33. What happens if a file opened with 'ofstream' already exists?
34. What are the two valid keywords used for an exception?
35. 5 'try' block is used to
36. In f=open("fun.txt", 'r'), 'r' refers to .....
37. How do you create a new directory in Python?
38. A variable defined inside the def() we called as
39. What is the output of the following code?def greet(name="Guest"):print(f"Hello, {name}!")greet("Alice")greet()
40. What is the purpose of saving data to a file in a program?
41. What is the output of:x = ["apple", "banana"]print("banana" in x)
42. Address stored in the pointer variable is of type.
43. The ..... enables you to write or read data in a position wherever you want.
44. What is the role of the 'pickle' module in data serialization?
45. How can you read a binary file in Python?
46. What does the 'os.path.split()' function return?
47. ..... function without any argument removes leading and trailing whitespaces.
48. Explain the difference between reading a file in text mode and binary mode.
49. Which function is used to write data in binary file?
50. In a file, user want to add and write the data means, he want to open the file in ..... , , , mode
51. What is the purpose of using Fileoutputstream in Java?
52. What is the purpose of the 'csv.writer' object?
53. If there is any error while opening a file, fopen will return?
54. What happens when you try to open a file that does not exist using the code?with open("test.txt", 'w') as f:
55. Choose the correct statement to close a file stream named myfile:
56. Apa yang dimaksud dengan operasi "menambahkan data" ke file?
57. You must write pickle.load() enclosed in ..... and ..... statements.
58. What is the correct syntax to close a file in the pseudocode provided?
59. How do you open a CSV file in Python?
60. Which mode opens a file for reading and writing in Python?