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

Quiz Instructions

Select an option to see the correct answer instantly.

1. When writing to a file you cannot create new lines.
2. Assertion:The file modes "r" , "w" , "a" also reveal the type of file these are being used with. Reason:The binary file modes have 'b' suffix with regular file modes.
3. Which data type would you use for the quantity of stock in a shop?
4. Which method is used to retrieve or read pickled data from a binary file into a Python object?
5. Which of the following statements about file paths is true?
6. Which statement is used for error handling in file operations?
7. Which one uses the open() function under read mode correctly and saves the file object to a variable?
8. Which of the following is a type of file in Python?
9. What is the method to write data to a file in Python?
10. Let x= "Python", the output of print(x.upper()) is
11. What does the abspath() function do?
12. What will be the output of the following code snippet?f = open("abc.txt", "w")x = f.read()f.close()print (x)
13. Which of the following is not a method of opening files?
14. What is the purpose of the flush() method in Python file handling?
15. What are the two parameters of the open() function in Python?
16. Which of the following statements is true about text files?
17. What is the correct way to add 1 to the $ count variable?
18. Which mode is used to open the text file for reading purpose?
19. Which type of file represent in tabular form / Record
20. What is the difference between writing to a file and appending to a file in Python?
21. What is the return type of fread() function in C?
22. Which of the following is used to open a file in write mode?
23. How many parameters does the open() function take in Python?
24. What is the syntax to read a file in Python?
25. Which library is commonly used for Machine Learning programs in Python?