This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 6 File Handling – Quiz 16 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 6 File Handling Quiz 16 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. What is the purpose of the 'write lines' method in Python file handling? A) Writes a structure such as a list to a file. B) Writes the entire file at once. C) Writes a specific line to the file. D) Writes a single line to the file. Show Answer Correct Answer: A) Writes a structure such as a list to a file. 2. .... function is used to write data in a binary file A) Pickle.write(). B) Pickle.writeline(). C) Pickle.load(). D) Pickle.dump(). Show Answer Correct Answer: D) Pickle.dump(). 3. File object is reference to a file. It is used to read and write data to a file. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 4. Which one of the following databases has PHP supported almost since the beginning? A) SQL. B) MySQL. C) Oracle Database. D) None. Show Answer Correct Answer: B) MySQL. 5. What method is used to write data to a CSV file? A) Use a text editor to manually enter data. B) Utilize a database management system for CSV output. C) Save data as a JSON file instead. D) Use a CSV writing library or function, such as Python's 'csv.writer'. Show Answer Correct Answer: D) Use a CSV writing library or function, such as Python's 'csv.writer'. 6. What does the "b" mode specify when opening a file in Python? A) Buffer mode. B) Binary mode. C) Backup mode. D) Byte mode. Show Answer Correct Answer: B) Binary mode. 7. What mode would you use to append data to an existing file? A) W. B) Rw. C) R. D) A. Show Answer Correct Answer: D) A. 8. What must a program do before reading or writing to a file? A) Open the file in the appropriate mode. B) Close all other files in the system. C) Copy the file contents into an array. D) Convert the file into binary format. Show Answer Correct Answer: A) Open the file in the appropriate mode. 9. Why is it important to close the file when file handling? A) It wont work if you dont. B) The content will be lost. C) Uses up a lot of memory. D) The program will crash. Show Answer Correct Answer: C) Uses up a lot of memory. 10. Which is data type of file pointer? A) Int. B) Float. C) File. D) Double. Show Answer Correct Answer: C) File. 11. ..... & ..... statements together can handle runtime exceptions. A) Try & Except. B) Dump & Load. C) Seek & Tell. D) None of the above. Show Answer Correct Answer: A) Try & Except. 12. Choice3 A) 1. B) 9. C) 10. D) None of above. Show Answer Correct Answer: A) 1. 13. What does feof(fp) check? A) File exists. B) File format. C) End of file reached. D) File empty. Show Answer Correct Answer: C) End of file reached. 14. Closing files is important because it frees up RAM for other files and programs A) TRUE. B) FALSE. C) All the above. D) None of the above. Show Answer Correct Answer: A) TRUE. 15. Which of these is associated with a specific file and provides a way for the program to work with that file? A) Filename. B) Extension. C) File object. D) File variable. Show Answer Correct Answer: C) File object. 16. Apa nama method yang digunakan untuk menutup sebuah file yang terbuka di Python? A) Stop(). B) Finish(). C) Close(). D) End(). Show Answer Correct Answer: C) Close(). 17. What method should be called to close a FileWriter after writing? A) Close(). B) Terminate(). C) Finish(). D) End(). Show Answer Correct Answer: A) Close(). 18. Which of the following will read entire content of file(file object 'f')? A) F.reads(). B) F.read(all). C) F.read(). D) None of the above. Show Answer Correct Answer: C) F.read(). 19. What happens if you open a file in 'w' mode that already exists? A) Error. B) Reads content. C) Appends to content. D) Overwrites content. Show Answer Correct Answer: D) Overwrites content. 20. What is a CSV file? A) A file format for data storage organized with records on each line. B) A binary file format for images. C) A text file format for programming code. D) A file format for audio data. Show Answer Correct Answer: A) A file format for data storage organized with records on each line. 21. When we read from a file, what type of value do we get returned to us, by default? A) Int. B) Float. C) Str. D) Bool. Show Answer Correct Answer: C) Str. 22. Which of the following is the correct way of declaring a float pointer? A) Float ptr. B) Float * ptr. C) *float ptr. D) Float ptr*. Show Answer Correct Answer: B) Float * ptr. 23. In the data hierarchy, which of the choices is described as 'single values of letter or numbers'? A) File. B) Records. C) Characters. D) Bits. Show Answer Correct Answer: C) Characters. 24. Which mode create new file if the file does not exist? A) Write mode. B) Append mode. C) Both. D) None of the above. Show Answer Correct Answer: C) Both. 25. Is there a delimiter for binary files A) Yes. B) No. C) All the above. D) None of the above. Show Answer Correct Answer: B) No. ← 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