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

Quiz Instructions

Select an option to see the correct answer instantly.

1. Which mode in binary files is used to keep the previous data of an existing file along with add the new data at the end of it .
2. What might happen if you fail to close a file after operations in a program?
3. Which function is used to find the length of the list?
4. It opens the file for the output then moves the read and write control to the file's end.
5. The Binary file mode 'wb' represent?
6. Structure variables are accessed using:
7. What are the three steps of file handling in Python?
8. What is the first step to write data to a CSV file?
9. What will be the output-x=""if(!x):print("hello")else:print("bye")
10. Which command reads data from an open file into a variable?
11. The syntax of seek() is:file ..... object.seek(offset [, reference ..... point]) What does reference ..... point indicate?
12. When writing to a file you cannot create new lines.
13. 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.
14. Which data type would you use for the quantity of stock in a shop?
15. Which method is used to retrieve or read pickled data from a binary file into a Python object?
16. Which of the following statements about file paths is true?
17. Which statement is used for error handling in file operations?
18. Which one uses the open() function under read mode correctly and saves the file object to a variable?
19. Which of the following is a type of file in Python?
20. Let x= "Python", the output of print(x.upper()) is
21. What does the abspath() function do?
22. What will be the output of the following code snippet?f = open("abc.txt", "w")x = f.read()f.close()print (x)
23. Which of the following is not a method of opening files?
24. What is the purpose of the flush() method in Python file handling?
25. What are the two parameters of the open() function in Python?
26. Which of the following statements is true about text files?
27. What is the correct way to add 1 to the $ count variable?
28. Which type of file represent in tabular form / Record
29. What is the difference between writing to a file and appending to a file in Python?
30. What is the return type of fread() function in C?
31. Which of the following is used to open a file in write mode?
32. How many parameters does the open() function take in Python?
33. What is the syntax to read a file in Python?
34. Which library is commonly used for Machine Learning programs in Python?
35. You can use loops to write large amounts of text to a file
36. ASCII stands for
37. Which module is used to work with text files?
38. Which mode is used to add data to an existing file?
39. What does "non-volatile data storage" mean?
40. In which of the following package, Exception class exist?
41. Which is correct way to write rows in CSV file?
42. Which method is used to read all lines from a file into a list in Python?
43. EOF is an integer type defined in stdio. h and has a value .....
44. What is the purpose of the function fclose?
45. Select the most appropriate format of tell ()
46. What is the correct way to read a file in Python?
47. Why is it best to open a file with "with" in Python?
48. What is the difference in path styles between Windows and macOS/Linux?
49. What is the process of converting a Python object structure into a byte stream to store in a binary file called?
50. How do you close a file in C using fclose()?
51. When fwrite is used on already existing file the what will happen
52. What is the purpose of fprintf() and fscanf() functions in C?
53. What method do we use as a clean up function, to reallocate the resources used when keeping the file object open?
54. What does the 'APPEND' mode do when a file is opened in this mode?
55. Which function is used to force transfer of data from buffer to file?
56. What does the 'A' parameter signify in the 'open' command when opening a file in Python?
57. Function used to write data in binary format
58. Which statement is true to open a binary file "Record.txt" for writing and reading?
59. Which function is used to read all the characters?
60. Class exception ..... handling { public static void main(String args[]) { try { int a, b; b = 0; a = 5 / b; System.out.print("A"); } catch(ArithmeticException e) { System.out.print("B"); } finally { System.out.print("C"); } } }