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

Quiz Instructions

Select an option to see the correct answer instantly.

1. Which of the following file modes is best for adding new data to the end of an existing file without overwriting its contents?
2. Assertion:CSV is a file format for data storage which looks like a text file. Reason:The information is organized with one record on each line and each field is separated by comma.
3. A programmer want to read and write a file fastly. He want to use ..... file.
4. We want to write something in test.txt file. what is the correct syntax?
5. What does the parent attribute of a Path object return?
6. To read the remaining lines of the file from object fobj, we use:
7. What is the difference between r+ and w+ modes?
8. What is the expected output when passing 2 and 3 to the add ..... two function?
9. Apa yang harus dilakukan sebelum menulis data ke file?
10. Which of the following is NOT a valid file access mode?
11. Which method is used to write multiple lines to a file in Python?
12. Which of the following is used to open a file in Python?
13. Myfile=open ( "one.txt" )-here myfile is indicating .....
14. What is the correct way to open a file for both reading and writing in C++?
15. How can you catch multiple exceptions in a single try block?
16. What is the difference between binary and text file modes?
17. What is the difference between appending and writing to a file?
18. Which mode is used to open a file for both reading and writing in Python?
19. What function is used to read the entire content of a file in Python?
20. Which function is used to open a file
21. What is the default mode used by the open() function in Python when no mode is specified?
22. .py .java .c are .....
23. What is a potential consequence of not closing a file in a program?
24. The mode 'w+' means:
25. How many except statements can a try-except statement have?