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

Quiz Instructions

Select an option to see the correct answer instantly.

1. Which method reads a single line from a file in Python?
2. What is a file?
3. What will this line of code do?myFile = open("test ..... scores.txt", "r")
4. In CSV files, what does each row represent?
5. CSV file differs from binary file because:
6. When will the else part of try-except-else be executed?
7. File formats are specified in the file extension
8. What exception does the createNewFile() method throw if an error occurs?
9. If you will have to store roll numbers of all the students, then which python datatype will you use?
10. Which function is used to read records from a binary file?
11. What does the 'os.listdir()' function return?
12. What is advantage of binary files over text files?
13. What does the 'A' parameter do when opening a file?
14. Which command is used to open the file for read only
15. Why is it important to close a file after performing file I/O operations?
16. There is only one way to read a file in python.
17. What does the following code do?f=open("test.txt")
18. What will the following code do?with open('file.txt', 'w') as f:f.write('Hello, world!')
19. What does the 'ungetc()' function in C do?
20. What does Filehandle.writelines (L) function do
21. In the data hierarchy, which of the choices contains multiple records?
22. What does the 'eof' function check in file operations?
23. Which statement will return one line from a file (file object is 'f')?
24. 2 Which of the following statements are not true regarding the opening modes of a file?
25. The ..... device read from the keyboard.