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

Quiz Instructions

Select an option to see the correct answer instantly.

1. Which of the following is true about the WRITEFILE command?
2. Which Tkinter widget is used to display a message to the user?
3. What is file handling in Python?
4. File handling is carried out by the compiler
5. ..... Open the file for reading and writing.
6. By default python program save in which drive?
7. What library is commonly used for handling CSV files in Python?
8. Mode used for reading and writing in binary file
9. A ..... file stores information in the form of a stream of ASCII or UNICODE characters.
10. Data stored in the files are called
11. Which of the following is used to write text data?
12. Which of these will generate an error?
13. How do you convert a list of dictionaries to a CSV file?
14. What does the 'tell()' function return?
15. A data of the file is stored in
16. How can you append data to an existing text file?
17. To move the file pointer 10 bytes backward from the current position, which statement would you use?
18. What function is used to read a specific number of bytes from a file in Python?
19. Every file has its own identity associated with it. Which is known as
20. JPEG stands for .....
21. How do you write data to a file using Fileoutputstream in Java?
22. What would be the size of the following union declaration? (Assuming size of double = 8, size of int = 4, size of char = 1) #include union uTemp { double a; int b[10]; char c; }u;
23. Str = "CBSE Class XII Python Examination 2024"Filein = open("myfile.txt", "w+")print("Name of the file: ", Filein.name)Filein.writelines(Str)Filein.seek(0, 0)for line in Filein:print(line)Filein.close()
24. Why do we save files?
25. What is the return type of the length() method in the File class?
26. What is a file in the context of data storage?
27. When opening a file for writing using OPENFILE "data.txt" FOR WRITE, what happens if "data.txt" already exists?
28. Files don't need to be closed when using file handling in programming
29. Write the output of the following:>>> f = open("test.txt", "w") >>> f.closed >>> f.close() >>> f.closed
30. What is the purpose of the 'seek' method in Python file handling?
31. An interrupt or forced disruption that occurs when a program is run or executed is termed as
32. What is the output of this program? #include int main(){typedef struct tag {char str[10];int a;} tag;tag h1, h2 = { "IHelp", 10 };h1 = h2;h1.str[1] = 'h';printf("%s, %d", h1.str, h1.a);return 0;}
33. What is the primary function of fopen() in C programming?
34. What will malloc() return if it fails to allocate memory?
35. Sizeof(struct) gives:
36. What is one way to avoid accidental changes to a file?
37. Which is more secure for sensitive data?
38. Explain the process of reading a file line by line in Python.
39. Fp.readlines() returns data as a
40. What does the function fgets do in file handling?
41. What does the abs() function in Python do?
42. What is the purpose of defining a function in Python?
43. What is the prerequisite knowledge before learning file handling?
44. CSV files are known as flat text files. Is the statement true or false.
45. Name the module that has to be imported to write a binary file.
46. What does this code myfile=open( "taxes.txt" ) perform
47. Which of the following is a function of the pickle module?
48. What is the mode 'w' used for when opening a file?
49. How can you check if a path is absolute using pathlib?
50. Which of the following classes can be used for both reading and writing to a file in C++?
51. What is the output of the program that reads and writes using binary mode?
52. Choose an exception if attempt to divide number by zeroint number = 89 / 0;System.out.println("The answer is '' + number);
53. What does the method returns?
54. What is used to store values in variables
55. What is the output of the following program? import csv d=csv.reader(open ("city.csv'))next(d)for row in d:print(row) if the file called "city.csv" contain the following detailschennai, mylaporemumbai, andheri
56. To append text to an existing file without erasing its contents, which mode should you use?
57. In which mode, should we open the file to add data into the file?
58. How can you write data to a file in Python?
59. In this program, what does the function myAdd do?def myAdd(a, b) return a+b
60. Serial Files are organized by time.