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

Quiz Instructions

Select an option to see the correct answer instantly.

1. Which of the following commands can be used to read the remaining lines in a file using the file object ?
2. Which function will remove a file from the directory?
3. What does the 'readline()' function do?
4. What does the 'readline()' method do?
5. What is the purpose of rename()?
6. What is the purpose of the 'with' statement in file handling?
7. What happens if you try to read from a file that has been opened in write mode?
8. What will be the output of the following statement in python? (fh is a file handle) fh.seek(-30, 2) Options:-It will place the file pointer:-
9. Which function writes a character to a file?
10. What mode would you use to write to a file, overwriting its contents?
11. Appending to a file means adding extra data into the file.
12. Which step creates a connection between a file and a program?
13. Explain the process of reading from a file in Python.
14. What is the output of following program#include int main()\{ extern int i; printf("%d ", i); \{ int i = 10; printf("%d ", i); \} return 0; \}
15. Which of the following needs to be used to provide access to the file throughout a program?
16. ..... method writes all given rows to the csv file.
17. Full form of CSV.
18. Simple programs can't make use of text files to store data for access again
19. The default file mode is ..... mode:
20. Which statement is TRUE about file reading in Python?
21. What is the purpose of the 'with' statement when handling files?
22. What keyword in Python is used to load other Python source code files into your current code page?
23. The data files are the files that stored ..... to specific application for later use.
24. File data.txt contains "Hello" .f=open("data.txt", "w")f.write("World")f.close()What will be the content of file?
25. What will the following code do?with open('test.txt', 'w') as file:file.write("Hello World")