This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 6 File Handling – Quiz 43 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 6 File Handling Quiz 43 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. CSV files are known as flat text files. Is the statement true or false. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 2. Name the module that has to be imported to write a binary file. A) Csv module. B) Pickle module. C) Unpickle module. D) Random module. Show Answer Correct Answer: B) Pickle module. 3. What does this code myfile=open( "taxes.txt" ) perform A) Opens the taxes.txt in default read mode. B) Opens the taxes.txt in default write mode. C) Opens the taxes.txt in default append mode. D) Opens the taxes.txt in default read and write mode. Show Answer Correct Answer: A) Opens the taxes.txt in default read mode. 4. Which of the following is a function of the pickle module? A) Reader(). B) Writer(). C) Load(). D) Read(). Show Answer Correct Answer: C) Load(). 5. What is the mode 'w' used for when opening a file? A) Read. B) Append. C) Execute. D) Write. Show Answer Correct Answer: D) Write. 6. How can you check if a path is absolute using pathlib? A) Using the is absolute() method. B) Using the is relative() method. C) All the above. D) None of the above. Show Answer Correct Answer: A) Using the is absolute() method. 7. Which of the following classes can be used for both reading and writing to a file in C++? A) 'ifstream'. B) 'ofstream'. C) 'fstream'. D) 'istream'. Show Answer Correct Answer: C) 'fstream'. 8. What is the output of the program that reads and writes using binary mode? A) Name:John Doe, Age:30. B) Error opening file. C) Data written to file successfully. D) File not found. Show Answer Correct Answer: A) Name:John Doe, Age:30. 9. Choose an exception if attempt to divide number by zeroint number = 89 / 0;System.out.println("The answer is '' + number); A) ArithmeticException. B) NullPointerException. C) NumberFormatException. D) ArrayIndexOutOfBoundException. Show Answer Correct Answer: A) ArithmeticException. 10. What does the method returns? A) Str. B) A list of lines. C) List of single characters. D) List of integers. Show Answer Correct Answer: B) A list of lines. 11. What is used to store values in variables A) Rom. B) Prom. C) Ram. D) Pram. Show Answer Correct Answer: C) Ram. 12. 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 A) Chennai, mylapore. B) Mumbai, andheri. C) Chennaimumbai. D) Chennai, mylaporemumbai, andheri. Show Answer Correct Answer: B) Mumbai, andheri. 13. To append text to an existing file without erasing its contents, which mode should you use? A) "r+". B) "w+". C) "a". D) "wb". Show Answer Correct Answer: C) "a". 14. In which mode, should we open the file to add data into the file? A) R. B) W. C) A. D) Write. Show Answer Correct Answer: C) A. 15. How can you write data to a file in Python? A) Use 'open('filename.txt', 'r') as file:file.write('data')'. B) Write 'data' to file using 'open('filename.txt', 'a')' method. C) Use 'with open("filename.txt", "w") as file:file.write("data")'. D) Use 'with open('filename.txt', 'x') as file:file.write('data')' to write. Show Answer Correct Answer: C) Use 'with open("filename.txt", "w") as file:file.write("data")'. 16. In this program, what does the function myAdd do?def myAdd(a, b) return a+b A) Subtracts two numbers. B) Multiplies two numbers. C) Adds two numbers. D) Crashes the program. Show Answer Correct Answer: D) Crashes the program. 17. Serial Files are organized by time. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 18. Apa tipe data yang akan dikembalikan oleh fungsi pandas.read ..... csv()? A) String. B) Dictionary. C) DataFrame. D) Ndarray. Show Answer Correct Answer: C) DataFrame. 19. The ..... mode adds the data to the end of file. A) Write. B) Append. C) Read. D) Both write and append. Show Answer Correct Answer: B) Append. 20. Tell( ) function use to see the current position of the file pointer. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 21. Which mode specifier will open a file but will not let you change the file or write to it? A) 'w'. B) 'r'. C) 'a'. D) 'E'. Show Answer Correct Answer: B) 'r'. 22. What are the basic file operations in Python? A) The basic file operations in Python are:open, read, write, and close. B) Open, save, import, export. C) Read, write, append, sync. D) Create, delete, modify, execute. Show Answer Correct Answer: A) The basic file operations in Python are:open, read, write, and close. 23. To perform File I/O operations, Which of the following header files is used? A) . B) . C) . D) Any of these. Show Answer Correct Answer: C) . 24. What does this code do?file.write ( song ) A) It writes the word "song" to the file. B) It writes the variable "song" to the file. C) It reads the word "song" from the file. D) It reads the variable "song" from the file. Show Answer Correct Answer: B) It writes the variable "song" to the file. 25. Exception generated by try block is caught in ..... block? A) Catch. B) Throw. C) Throws. D) Finally. Show Answer Correct Answer: B) Throw. ← PreviousNext →Related QuizzesClass 11 Computer Science Chapter 6 File Handling Quiz 1Class 11 Computer Science Chapter 6 File Handling Quiz 2Class 11 Computer Science Chapter 6 File Handling Quiz 3Class 11 Computer Science Chapter 6 File Handling Quiz 4Class 11 Computer Science Chapter 6 File Handling Quiz 5Class 11 Computer Science Chapter 6 File Handling Quiz 6Class 11 Computer Science Chapter 6 File Handling Quiz 7Class 11 Computer Science Chapter 6 File Handling Quiz 8Class 11 Computer Science Chapter 6 File Handling Quiz 9Class 11 Computer Science Chapter 6 File Handling Quiz 10 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books