This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 6 File Handling – Quiz 20 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 6 File Handling Quiz 20 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. EOL stands for A) End Of Line. B) End Of List. C) End of Lines. D) End Of Location. Show Answer Correct Answer: A) End Of Line. 2. What is the significance of working with file paths in Python file handling? A) Working with file paths in Python file handling has no impact on data management. B) File paths in Python file handling are only used for decorative purposes. C) Python file handling does not support file paths. D) File paths in Python file handling are essential for specifying the location of files on the system, enabling reading, writing, and managing data effectively. Show Answer Correct Answer: D) File paths in Python file handling are essential for specifying the location of files on the system, enabling reading, writing, and managing data effectively. 3. Describe the use of the Pickle Module in Python. A) The Pickle module in Python is used for serializing and deserializing Python objects. B) Pickle Module is used for controlling the temperature of pickles in Python. C) Pickle Module is used for generating random pickles in Python. D) The Pickle module is used for creating pickled vegetables in Python. Show Answer Correct Answer: A) The Pickle module in Python is used for serializing and deserializing Python objects. 4. ..... function returns the list of strings. A) Read(). B) Readline(). C) Readlines(). D) None of the above. Show Answer Correct Answer: C) Readlines(). 5. Arrays are often used to hold data read from files. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 6. How do you open a file for reading in Python? A) Use 'load('filename.txt')' to read. B) Open with 'open('filename.txt', 'w')'. C) Use 'read('filename.txt')'. D) Use 'open('filename.txt', 'r')'. Show Answer Correct Answer: D) Use 'open('filename.txt', 'r')'. 7. To open a file in text mode, which character is used? A) 't'. B) 'x'. C) 'b'. D) None. Show Answer Correct Answer: A) 't'. 8. What is the function "a" in file handling A) Read. B) Write. C) Append. D) None of the above. Show Answer Correct Answer: C) Append. 9. What is the purpose of the readlines() function? A) To read all lines from a file and return them as a list. B) To read a single line from a file. C) To write all lines to a file. D) To count the number of lines in a file. Show Answer Correct Answer: A) To read all lines from a file and return them as a list. 10. Apa yang harus dilakukan setelah menulis ke file untuk memastikan data tersimpan dengan benar? A) Mengubah nama file. B) Menghapus file yang sudah ada. C) Menyalin file ke lokasi lain. D) Menutup file dengan close(). Show Answer Correct Answer: D) Menutup file dengan close(). 11. File Object is also Known as A) File handle. B) File window. C) File Modes. D) All these. Show Answer Correct Answer: A) File handle. 12. Used to get data from datafile and send output into datafile. A) Files. B) File processing. C) Data files. D) File handling. Show Answer Correct Answer: D) File handling. 13. What does the "a" mode do when opening a file in Python? A) Appends to a file, error if the file does not exist. B) Appends to a file, creates the file if it does not exist. C) Appends to a file, truncates the file first. D) Appends to a file, reads from the file first. Show Answer Correct Answer: B) Appends to a file, creates the file if it does not exist. 14. Which of the following is used to separate a line into words. A) Words(). B) Linestowords(). C) Separate(). D) Split(). Show Answer Correct Answer: D) Split(). 15. Expand EOF A) Exit of file pointer. B) Exit of File. C) End of file pointer. D) End of File. Show Answer Correct Answer: D) End of File. 16. What is the difference between 'rb' and 'wb' file modes? A) Both 'rb' and 'wb' are used for reading files, but in different formats. B) 'rb' is for writing text files, and 'wb' is for reading text files. C) The difference is that 'rb' is for reading binary files, and 'wb' is for writing binary files. D) 'rb' is for reading files in ASCII format, while 'wb' is for writing in UTF-8. Show Answer Correct Answer: C) The difference is that 'rb' is for reading binary files, and 'wb' is for writing binary files. 17. What is the function used to open a file in Python for reading? A) Read(). B) OpenFile(). C) Open(). D) StartReading(). Show Answer Correct Answer: C) Open(). 18. Which method is used to write data to a csv file using the csv module in Python? A) Csv.write. B) Csv.append. C) Writecsv(). D) Appendcsv(). Show Answer Correct Answer: A) Csv.write. 19. What is the meant by 'a' in the following operation?fp = fopen("letsfindcourse.txt", "a"); A) Attach. B) Add. C) Apprehend. D) Append. Show Answer Correct Answer: D) Append. 20. How does the operating system manage memory allocation? A) The operating system uses hardware to manage memory allocation. B) The operating system relies on external devices for memory management. C) The operating system allocates memory using techniques like segmentation, paging, and virtual memory management. D) Memory allocation is handled solely by user applications. Show Answer Correct Answer: C) The operating system allocates memory using techniques like segmentation, paging, and virtual memory management. 21. 1 Which of the following command is used to open a file "temp.dat" in read-mode only? A) Infile = open( "temp.dat" , "r" ). B) Infile = open( "temp.dat" , "rb" ). C) Infile = open(file = "temp.dat" , "r+" ). D) Infile = open(file = "temp.dat" , "rb" ). Show Answer Correct Answer: B) Infile = open( "temp.dat" , "rb" ). 22. A binary file stores the information in the form of ..... A) Bytes. B) Stream of Bytes. C) 0's and 1's. D) .txt. Show Answer Correct Answer: B) Stream of Bytes. 23. What is the purpose of the 'F dot read' command in the Python file handling examples? A) To read a line from the file. B) To open the file for reading. C) To write data to the file. D) To close the file. Show Answer Correct Answer: A) To read a line from the file. 24. When using the read method to read characters from a file, what does the parameter "X" specify? A) The file name. B) The access mode. C) The number of characters to read. D) The file format. Show Answer Correct Answer: C) The number of characters to read. 25. What is a CSV file used for? A) Storing pictures. B) Saving simple tables of data. C) Running programs. D) Compressed files. Show Answer Correct Answer: B) Saving simple tables of data. ← 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