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

Quiz Instructions

Select an option to see the correct answer instantly.

1. How can you read a file line by line in Python?
2. What is the purpose of the with statement when working with files?
3. This function connects the file written on the disk with file object
4. What is the code to open a file named as My ..... Data for reading data from it?
5. The file pointer is reset to the start of the file using:
6. We don't need to be careful with the 'w' mode as it will not overwrite into the file if it already exists.
7. What is the difference between 'r' and 'rb' file modes?
8. What is the description of the following file mode 'w+'
9. File formats are specified in the file name
10. Which mode is used to write to a file (overwriting if exists)?
11. Which library is used in Python for binary file serialization?
12. Which function is used to unpickle data from a binary file?
13. What is the root folder on Windows typically referred to as?
14. Which function is used to check if the end of a file has been reached?
15. How can you ensure data is read one line at a time from a file?
16. 'w' mode creates a new file if one did not exist at the specified location.
17. Apa yang akan terjadi jika Anda mencoba membaca dari file yang tidak ada?
18. How do you append text to a file?
19. What is the purpose of the program in Program 13.2?
20. Which type of file format is used to store tabular data like in a spreadsheet?
21. How do you create a Fileinputstream object in Java?
22. Select the statement to open a file named MYDATA.txt in read and write mode. Let the file object name be myfile.
23. Which method is used to write text to a file in Python?
24. What method is used to read a file line by line?
25. What is the function of the 'getline' method in C++ file handling?