This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 6 File Handling – Quiz 64 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 6 File Handling Quiz 64 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. What is the role of next() when Rashil is working with CSV files in Python? A) Next() is used to convert CSV data into a dictionary. B) Next() is used to read the entire CSV file at once. C) Next() is used to skip the header row in CSV files. D) Next() is used to write data to a new CSV file. Show Answer Correct Answer: C) Next() is used to skip the header row in CSV files. 2. Dump function is used to ..... A) Write data in file. B) Read data from file. C) Destroy the file. D) Delete the content of file. Show Answer Correct Answer: A) Write data in file. 3. What is the file object's attribute to get file name? A) File. B) Name. C) Filename. D) Getname. Show Answer Correct Answer: B) Name. 4. An absolute path name begins at the A) Leaf. B) Stem. C) Root. D) Current directory. Show Answer Correct Answer: C) Root. 5. Which of these method of FileReader class is used to read characters from a file? A) Read(). B) Scanf(). C) Get(). D) GetInteger(). Show Answer Correct Answer: A) Read(). 6. 'w+' mode will ..... A) First write the file by deleting the contents of the existing file, if the file exists. B) First read the file and then write the contents by deleting its contents, if the file exists. C) First write and then read the file contents, by deleting the contents of the file if the file exists. D) First read and then write the contents, by deleting the contents of the file if the file exists. Show Answer Correct Answer: C) First write and then read the file contents, by deleting the contents of the file if the file exists. 7. What module provides access to some variables used or maintained by the interpreter? A) Sys. B) Io. C) Path. D) Os. Show Answer Correct Answer: A) Sys. 8. Which mode is used to open a text file for reading? A) W. B) R. C) A. D) Wb. Show Answer Correct Answer: B) R. 9. What is the significance of using 'with' when opening a file? A) It prevents any errors from occurring while writing. B) It ensures proper resource management by automatically closing the file. C) It allows for faster file access during reading. D) It enables multiple files to be opened simultaneously. Show Answer Correct Answer: B) It ensures proper resource management by automatically closing the file. 10. Which of the following is a valid way to read a file line by line? A) All of the above. B) File.readline(). C) File.readlines(). D) File.read(). Show Answer Correct Answer: A) All of the above. 11. What is an array? A) The name of a variable. B) A collection of variables of the same type. C) It's like an x-ray, but using a beams. D) None of the above. Show Answer Correct Answer: B) A collection of variables of the same type. 12. Which of the following is not a proper file access mode A) Read. B) Write. C) Close. D) Append. Show Answer Correct Answer: C) Close. 13. What does the 'write()' method do when called on a file object? A) Opens the file. B) Closes the file. C) Writes data to the file. D) Reads data from the file. Show Answer Correct Answer: C) Writes data to the file. 14. Which mode in binary files is used to keep the previous data of an existing file along with add the new data at the end of it . A) Rb. B) Wb. C) Ab. D) A. Show Answer Correct Answer: C) Ab. 15. Which of the following class is not related to input and output stream in terms of functioning? A) File. B) FileReader. C) FileWriter. D) InputStream. Show Answer Correct Answer: A) File. 16. What might happen if you fail to close a file after operations in a program? A) The file will automatically delete itself. B) The file becomes read-only. C) The file may be corrupt or be unreadable. D) The file's content will duplicate. Show Answer Correct Answer: C) The file may be corrupt or be unreadable. 17. Which function is used to find the length of the list? A) Len(). B) Size(). C) Length(). D) None. Show Answer Correct Answer: A) Len(). 18. It opens the file for the output then moves the read and write control to the file's end. A) Ios::ate. B) Ios::in. C) Ios::out. D) Ios::app. E) Ios::trunc. Show Answer Correct Answer: A) Ios::ate. 19. The Binary file mode 'wb' represent? A) Read only. B) Append. C) Read and Write. D) Write only. Show Answer Correct Answer: D) Write only. 20. Structure variables are accessed using: A) $\rightarrow$. B) . C) Either $\rightarrow$ or . D) :. Show Answer Correct Answer: C) Either $\rightarrow$ or . 21. What are the three steps of file handling in Python? A) Open the file, Process file, Close the file. B) Read the file, Write to the file, Delete the file. C) Create a file, Edit a file, Save a file. D) Open the file, Read the file, Write to the file. Show Answer Correct Answer: A) Open the file, Process file, Close the file. 22. What is the first step to write data to a CSV file? A) Open the file in 'w' mode. B) Create a new file. C) Use the csv.writer() method. D) Close the file. Show Answer Correct Answer: A) Open the file in 'w' mode. 23. What will be the output-x=""if(!x):print("hello")else:print("bye") A) Hello. B) Bye. C) Error. D) None. Show Answer Correct Answer: A) Hello. 24. Which command reads data from an open file into a variable? A) OPENFILE. B) READFILE. C) WRITEFILE. D) CLOSEFILE. Show Answer Correct Answer: B) READFILE. 25. The syntax of seek() is:file ..... object.seek(offset [, reference ..... point]) What does reference ..... point indicate? A) Reference point indicates the starting position of the file object. B) Reference point indicates the ending position of the file object. C) Reference point indicates the current position of the file object. D) None of the above. Show Answer Correct Answer: A) Reference point indicates the starting position of the file object. ← 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