This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 6 File Handling – Quiz 41 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 6 File Handling Quiz 41 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. What does fscanf() do? A) Reads formatted input from a file. B) Writes formatted output to a file. C) Checks for file errors. D) Resets the file position to the beginning. Show Answer Correct Answer: A) Reads formatted input from a file. 2. What function is used to close a file in Python? A) Close(). B) Finish(). C) Terminate(). D) End(). Show Answer Correct Answer: A) Close(). 3. If a CSV file contains header row, which function is used to skip it? A) Skipheader(). B) Next(reader). C) Reader.next(). D) Passheader(). Show Answer Correct Answer: B) Next(reader). 4. Which of the following is true about the WRITEFILE command? A) It can be used without opening the file first. B) It appends the data to the end of the file by default. C) It overwrites the existing content unless the file is opened in append mode. D) It reads data from the file and writes it to another file. Show Answer Correct Answer: C) It overwrites the existing content unless the file is opened in append mode. 5. Which Tkinter widget is used to display a message to the user? A) Message Widget. B) Entry Widget. C) Canvas Widget. D) Slider. Show Answer Correct Answer: A) Message Widget. 6. What is file handling in Python? A) Procedure for creating files in Python. B) Technique for organizing files in Python. C) Process of working with files in Python. D) Method of manipulating data in Python. Show Answer Correct Answer: C) Process of working with files in Python. 7. File handling is carried out by the compiler A) TRUE. B) FALSE. C) All the above. D) None of the above. Show Answer Correct Answer: B) FALSE. 8. ..... Open the file for reading and writing. A) Rw. B) 'r+'. C) R. D) Wr. Show Answer Correct Answer: B) 'r+'. 9. By default python program save in which drive? A) D Drive. B) C Drive. C) E Drive. D) F Drive. Show Answer Correct Answer: B) C Drive. 10. What library is commonly used for handling CSV files in Python? A) Pandas. B) Numpy. C) Json. D) Csv. Show Answer Correct Answer: D) Csv. 11. Mode used for reading and writing in binary file A) Wb. B) W. C) Wb+. D) W+. Show Answer Correct Answer: C) Wb+. 12. A ..... file stores information in the form of a stream of ASCII or UNICODE characters. A) Binary File. B) Text File. C) Both Binary and Text Files. D) CSV Files. Show Answer Correct Answer: B) Text File. 13. Data stored in the files are called A) Static data. B) Persistent data. C) Dynamic data. D) Rough data. Show Answer Correct Answer: B) Persistent data. 14. Which of the following is used to write text data? A) Pickle.dump(). B) Write(). C) Readlines(). D) Load(). Show Answer Correct Answer: B) Write(). 15. Which of these will generate an error? A) MyCipher.write("writing"). B) MyCipher write(writing). C) MyCipher.write("writing", writing). D) MyCipher.readline(). Show Answer Correct Answer: C) MyCipher.write("writing", writing). 16. How do you convert a list of dictionaries to a CSV file? A) Use a text editor to manually create the CSV file. B) Convert the list of dictionaries to a JSON file instead. C) Use Python's csv module to write the list of dictionaries to a CSV file. D) Use Excel to import the list of dictionaries directly. Show Answer Correct Answer: C) Use Python's csv module to write the list of dictionaries to a CSV file. 17. What does the 'tell()' function return? A) The content of the file. B) The size of the file. C) The current position of the file pointer. D) The name of the file. Show Answer Correct Answer: C) The current position of the file pointer. 18. A data of the file is stored in A) Ram. B) Hard disk. C) Rom. D) Rim. Show Answer Correct Answer: B) Hard disk. 19. How can you append data to an existing text file? A) Open the file in read mode and write the data. B) Open the file in append mode and write the data. C) Delete the existing file and create a new one with the data. D) Open the file in write mode and overwrite the data. Show Answer Correct Answer: B) Open the file in append mode and write the data. 20. To move the file pointer 10 bytes backward from the current position, which statement would you use? A) F.seek(-10, 0). B) F.seek(10, 1). C) F.seek(-10, 1). D) F.seek(-10, 2). Show Answer Correct Answer: C) F.seek(-10, 1). 21. What function is used to read a specific number of bytes from a file in Python? A) Fetch bytes(size). B) Get bytes(size). C) Read(size). D) Read bytes(). Show Answer Correct Answer: C) Read(size). 22. Which function is used to close a file in Python? A) Terminate(). B) Finish(). C) Close(). D) End(). Show Answer Correct Answer: C) Close(). 23. Every file has its own identity associated with it. Which is known as A) -a. icon. B) B. extension. C) C. format. D) D. file type. Show Answer Correct Answer: B) B. extension. 24. JPEG stands for ..... A) Joint Photographic Experts Group. B) Junior Photographic Experts Group. C) Joint Photographic Exchange Group. D) Joint Protocol Exchange Group. Show Answer Correct Answer: A) Joint Photographic Experts Group. 25. How do you write data to a file using Fileoutputstream in Java? A) Use BufferedWriter to write data to the file. B) Use PrintWriter to write data to the file. C) Create an instance of FileOutputStream and use its write() method to write data to the file. D) Use FileReader to write data to the file. Show Answer Correct Answer: C) Create an instance of FileOutputStream and use its write() method to write data to the file. ← 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