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

Quiz Instructions

Select an option to see the correct answer instantly.

1. What does the 'WRITE' mode do when a file is opened in this mode?
2. What are some common exceptions that can occur during file operations in Python?
3. Abhishek and Adivya are working on a project that involves reading data from a CSV file. They need to skip the header row to process the data correctly. How can they achieve this?
4. How can you check if a file exists at a specified path in Python?
5. Which module in Python is used to process csv file
6. What is the primary purpose of file handling in Python?
7. What modules can be used for binary and CSV file operations in Python?
8. How can you handle errors in file operations in Python?
9. Internal translations takes place in ..... files
10. The ..... device able to read an error message.
11. Which function is used to open a file in C?
12. Which module is required to use function dump()?
13. When Reading from text files, which of the following should appear in the loop?
14. Which of the following is not a valid mode to open a text file?
15. What mode should be used to write to a binary file?
16. The ..... function removes the given character from trailing left ends.
17. How do you handle a ValueError when converting input to an integer?
18. Which mode do you use to open a file for reading in Python?
19. What is the purpose of the 'open()' function in programming?
20. Readlines() method return?
21. Which of the following functions is used to write data in the binary file?
22. Which mode in fopen() allows both reading and writing to a file without truncating it?
23. What does the readlines() method return when reading a text file?
24. Abhishek and Taran are working on a project that requires them to save data in a CSV file. They need to write a header row to the CSV file in Python without using DictWriter. How can they achieve this?
25. Which header file is required for using file handling functions in C?
26. What is the purpose of the Writer function in CSV file handling?
27. What will happen if you try to open a file that does not exist in the read mode ("r") in Python?
28. Jika kita ingin menambahkan data ke file tanpa menghapus isi yang ada, kita menggunakan mode apa?
29. What is the extension of a binary file usually used in Python?
30. Difference between r+ and w+
31. Which mode in Python is used to open a file for creating (and return an error if the file exists)?
32. Write the output of the following:f=open("test.txt", "w+") f.write("File-Handling") a=f.read(5) print(a)
33. Read() function keep the file pointer at .....
34. What is the function of 'os.makedirs()'?
35. Which of the following commands canbe used to read "n" number of characters from a file using the file object ?
36. What does the relpath() function return?
37. What does the last byte of a file contain?
38. What is the purpose of error handling in file operations?
39. What is a file in the context of programming?
40. In ..... storage value of variable is not lost even though the computer is not supplied electricity
41. What will be the output of the following code?import java.io.*; class demoFile { public static void main(String args[]) {File f = new File("C:/java/xyz"); System.out.print(f.getName()); } }
42. What is the significance of working with file paths in Python file handling?
43. Describe the use of the Pickle Module in Python.
44. ..... function returns the list of strings.
45. Arrays are often used to hold data read from files.
46. How do you open a file for reading in Python?
47. To open a file in text mode, which character is used?
48. What is the function "a" in file handling
49. What is the purpose of the readlines() function?
50. Apa yang harus dilakukan setelah menulis ke file untuk memastikan data tersimpan dengan benar?
51. File Object is also Known as
52. Used to get data from datafile and send output into datafile.
53. Which of the following is used to separate a line into words.
54. What is the difference between 'rb' and 'wb' file modes?
55. Which method is used to write data to a csv file using the csv module in Python?
56. What is the meant by 'a' in the following operation?fp = fopen("letsfindcourse.txt", "a");
57. How does the operating system manage memory allocation?
58. 1 Which of the following command is used to open a file "temp.dat" in read-mode only?
59. A binary file stores the information in the form of .....
60. What is the purpose of the 'F dot read' command in the Python file handling examples?