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

Quiz Instructions

Select an option to see the correct answer instantly.

1. What happens if you open a file in w mode and it already exists?
2. Which read method(s) will read the entire contents of the file (by default)?
3. How can you delete a file in Python?
4. What does the suffix attribute of a Path object return?
5. What is the difference between 'read()' and 'readlines()'?
6. Name the module that has to be imported to write a csv file.
7. In which mode does a file get created if it doesn't already exist?
8. Why is data stored in a file instead of only using variables in a program?
9. A(n) ..... access file is also known as a direct access file.
10. Which exception is raised when trying to open a file that does not exist?
11. What is the purpose of the 'newline' parameter in the open() function?
12. The w+ mode to facilitate .....
13. Ftell() returns .....
14. In which mode do we open a file for reading and writing binary data?
15. Which of the following function is used with the csv module in Python to read the contents of a csv file into an object
16. Explain the difference between 'read()' and 'readlines()' methods.
17. What is the function "w" in file handling
18. How do you allocate memory for an integer variable in C using malloc()?
19. What is the use of the 'seek' method in file handling?
20. Which of the following is a built-in module in Python?
21. What will happen if you try to read from a closed file?
22. Which one of the following access mode does not allow writing
23. Which function is used to move the file position to a desired location within the file?
24. When reading from text files, which of the following can you use to check ifthe last line of a testfile called (FileA.txt) has been reached?
25. What happens if a recursive function does not have a base case?