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

Quiz Instructions

Select an option to see the correct answer instantly.

1. What is the purpose of closing a file in Python?
2. Pri ispisu primjerice "Hello world" u datoteku pozdrav.txt preko objekta ispis, pravilno je zapisati:
3. Which stream used to read data from a source, it may be a file, an array, peripheral device or socket?
4. What is the output of the length() method if the file is empty?
5. Which is called as Direct Access?
6. Predict the output of above program. Assume that the size of an integer is 4 bytes and size of character is 1 byte. Also assume that there is no alignment needed.union test{ int x; char arr[4]; int y;};int main(){ union test t; t.x = 0; t.arr[1] ='G'; printf("%s", t.arr); return 0;}
7. A class which is capable of creating files, writing to files, reading from data files is called
8. Which mode is taken as default mode for opening a File in Python?
9. Which of the following method is used to read from file?
10. The output of executing string.ascii ..... letters can also be achieved by:
11. Which Tkinter component is used to manage the arrangement of widgets?
12. During a class project, Reyansh and Tanisha were discussing how to handle data files. They wondered what the default delimiter is when using the csv module in Python.
13. Which method is used to write multiple lines to a file?
14. Sequential Access will be slower when compared to random access? State True or False
15. Which file mode ensures new data is always added at end without overwriting?
16. Mana yang berarti menulis ke file?
17. What does the 'os.rmdir()' function do?
18. Which of the following is a valid way to check if a path exists?
19. ..... files are used to store binary data(machine code) such as images, video and audio files
20. Identify the error in the following code. 1. f = open ("workfile.txt', 'r+') 2. f.write('0123456789abcdef') 3. f.write('xyz8466') 4. f.close() 5. f.seek (0) 6. f.read()
21. What should you do if the data read from the file does not match the search criteria?
22. Which function is used to dynamically allocate memory in C?
23. The unexpected event happened during program execution should be handled by
24. What are the types of files mentioned in the lesson plan?
25. List and describe different types of directory structures.
26. How do you convert user input to a float safely?
27. What is the correct definition for a VARIABLE?
28. Given the following file opened as song ..... file:I can't write one song that's not about youCan't drink without thinkin' about youIs it too late to tell you thatEverything means nothing if I can't have you?What is the result ofprint(song ..... file.read(4))?
29. What does file handling in Python allow you to do?
30. Which of the following error is returned when we try to open a file in read mode which does not exist?
31. File can be 'looked at' by the program but not changed. Error if the file doesn't already exist.
32. Assertion:'Pickling' is the process whereby a Python object hierarchy is converted into a byte-streams. Reason:A binary file works with byte-streams.
33. Which function in pseudocode is used to write data to a file?
34. What is the importance of closing a file after file handling operations in Python?
35. Explain how to read a specific number of bytes from a binary file.
36. Predict the output of the following program#include int main(){ register int i = 10; int *ptr = &i; printf("%d ", *ptr); return 0; }
37. Which file is not binary file?
38. What are the different access modes available in Python for file handling?
39. How can you read the next line of a file using streaming?
40. Apa nilai default parameter dtype yang dikembalikan oleh fungsi numpy.loadtxt()?
41. What does fread() do?
42. What should a program do to prevent errors when working with files?
43. Which of the following file modes allows both reading and writing without overwriting?
44. What will be the output of the following C code? #include struct student { int no; char name[20]; }; void main() { student s; s.no = 8; printf("%d", s.no); }
45. Which methods will create the file if it is not found?
46. Name and explain at least three CPU scheduling algorithms.
47. Which mode allows us to add data to an existing file?file =open("poem.txt", " ..... ")
48. Apa fungsi dari fopen dalam pemrograman C?
49. What is the role of next() when Rashil is working with CSV files in Python?
50. Dump function is used to .....
51. What is the file object's attribute to get file name?
52. An absolute path name begins at the
53. Which of these method of FileReader class is used to read characters from a file?
54. 'w+' mode will .....
55. What module provides access to some variables used or maintained by the interpreter?
56. Which mode is used to open a text file for reading?
57. What is the significance of using 'with' when opening a file?
58. Which of the following is a valid way to read a file line by line?
59. What is an array?
60. What does the 'write()' method do when called on a file object?