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

Quiz Instructions

Select an option to see the correct answer instantly.

1. What happens when file opened in 'a' mode?
2. What will the following code snippet do?F=open("abc.txt", "a")x="class12"F.write(x)F.close()
3. What happens when '1' == 1 is executed?
4. Public class Foo { public static void main(String[] args) { try { return; } finally { System.out.println( "Finally" ); } } }
5. Which exception is handled while reading binary file?
6. We can create our own error types in Python?
7. What is the correct order of operations for reading from a file in pseudocode?
8. It is necessary to always create the file in the same default folder where Python has been installed.
9. How can you check if a file exists before deleting it?
10. The full name of a file is also called .....
11. ..... function will break the link of file object and file on the disk
12. How do you handle exceptions in Python while working with files?
13. Which class can be used to read data line by line using readLine() method?
14. Can values got from forms in html be given to php
15. Which Tkinter widget is used to create clickable elements for user interaction?
16. What will be the output of add ..... two(5, 7)?
17. The correct syntax of seek() is:
18. How do you close a file after opening it?
19. Which function is used to check the file opening mode of the file?
20. Which method reads a single line from a file in Python?
21. In CSV files, what does each row represent?
22. CSV file differs from binary file because:
23. When will the else part of try-except-else be executed?
24. File formats are specified in the file extension
25. What exception does the createNewFile() method throw if an error occurs?
26. If you will have to store roll numbers of all the students, then which python datatype will you use?
27. Which function is used to read records from a binary file?
28. What does the 'os.listdir()' function return?
29. What does the 'A' parameter do when opening a file?
30. Which command is used to open the file for read only
31. Why is it important to close a file after performing file I/O operations?
32. There is only one way to read a file in python.
33. What does the following code do?f=open("test.txt")
34. What will the following code do?with open('file.txt', 'w') as f:f.write('Hello, world!')
35. What does the 'ungetc()' function in C do?
36. What does Filehandle.writelines (L) function do
37. In the data hierarchy, which of the choices contains multiple records?
38. What does the 'eof' function check in file operations?
39. Which statement will return one line from a file (file object is 'f')?
40. The ..... device read from the keyboard.
41. What is the difference between 'read()' and 'readlines()' methods?
42. Load function of pickle module is used to
43. What method is used to read all lines from a text file?
44. What is a binary file in Python?
45. Which function is used to read all lines from a text file into a list?
46. The contents of a csv file "sample.csv" are shown below:sno, name, age1, Amit, 122, Harsh, 133, Vivek, 21
47. What is the standard input stream in Python?
48. What is the first index of an array?
49. What is the advantage of using CSV files?
50. Which operator is used in python to import all modules from package
51. Which method is used to close a file in Python?
52. Which of the following function do you use to write data in the binary file?
53. Which method is used to delete a file in Python?
54. Which one of the following methods is responsible for sending the query to the database?
55. How do you delete a file in Python?
56. Rashil is working on a project that involves analyzing sales data stored in a CSV file. Which Python module should he primarily use for handling these CSV files?
57. How do you properly close a file after performing operations on it in Python?
58. 6 What is the last action that must be performed while working with the files?
59. How can you check if a file exists before trying to open it?
60. Existing data is kept intact when append is use to write to a file