This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 6 File Handling – Quiz 56 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 6 File Handling Quiz 56 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. ..... is a processing of converting Python object hierarchy into a byte stream so that the contents can be written onto a file. A) Serialization/Pickling. B) Deserialization/ Unpickling. C) Conversion. D) Linking. Show Answer Correct Answer: A) Serialization/Pickling. 2. Which of these is correct to read one line of text file? A) Read(). B) Readline(). C) Readlines(). D) Readfileline(). Show Answer Correct Answer: C) Readlines(). 3. How to write a list of lines to a file? A) Write(list). B) Writeline(). C) Writelines(). D) Writeall(). Show Answer Correct Answer: C) Writelines(). 4. Which is CORRECT way to read all records from a binary file? A) While True:rec=pickle.load(f). B) For rec in f:pickle.load(rec). C) Pickle.read(f). D) F.load(). Show Answer Correct Answer: A) While True:rec=pickle.load(f). 5. The CSV files are popular because of ..... A) Easy to create. B) Easy to import and export. C) Capable of storing large data. D) All these. Show Answer Correct Answer: D) All these. 6. X = 5print(not(x > 3 and x < 10)) A) Not(x > 3 and x < 10). B) True. C) False. D) Syntax error. Show Answer Correct Answer: C) False. 7. What does fseek() do? A) Sets the file position. B) Gets the current position of the file pointer. C) Resets the file position to the beginning. D) Checks for file errors. Show Answer Correct Answer: A) Sets the file position. 8. Raise and assertion is a ..... A) Keyword. B) Statementt. C) Error. D) Both a and b. Show Answer Correct Answer: D) Both a and b. 9. A pointer variable contains as its value of another value. A) Address. B) Pointer. C) Memory. D) Void. Show Answer Correct Answer: C) Memory. 10. What is the difference between 'w' and 'a' file modes in Python? A) 'w' mode is used for reading and 'a' mode is used for writing. B) 'w' mode is used for appending and 'a' mode is used for writing. C) 'w' mode is used for reading and 'a' mode is used for appending. D) 'w' mode is used for writing and 'a' mode is used for appending. Show Answer Correct Answer: D) 'w' mode is used for writing and 'a' mode is used for appending. 11. A pointer is A) A keyword used to create variables. B) A variable that stores address of an instruction. C) A variable that stores address of a programmable entity. D) All the above. Show Answer Correct Answer: B) A variable that stores address of an instruction. 12. Which line of code is correct for opening a file in write mode A) Leader file w = open( "leaderboard.txt" , "r" ). B) Leader file w = open(leaderboard.txt, "w" ). C) Open( "leaderboard.txt" , "w" ). D) Leader file w = open( "leaderboard.txt" , "w" ). Show Answer Correct Answer: D) Leader file w = open( "leaderboard.txt" , "w" ). 13. How can you check if a file exists before attempting to open it? A) Use 'os.file check(file path)' in Python to verify file existence. B) Use 'file.exists(file path)' in Java to check for a file. C) Use 'os.path.exists(file path)' in Python to check if a file exists. D) Check if 'file path' is not empty before opening it. Show Answer Correct Answer: C) Use 'os.path.exists(file path)' in Python to check if a file exists. 14. Which particular header file is necessary to perform file handling in C++ A) Fstream.h. B) Conio.h. C) File.h. D) Math.h. Show Answer Correct Answer: A) Fstream.h. 15. ..... is the process Of converting Python object hierarchy into a byte stream. A) Serialization. B) Un Pickling. C) Tell(). D) Seek(). Show Answer Correct Answer: A) Serialization. 16. In our computer all software and files are store in A) DVD. B) CD. C) RAM. D) Hard Disk. Show Answer Correct Answer: D) Hard Disk. 17. Public char[] readPassword() blongs to whcih class A) Scanner Class. B) Console class. C) InputStreamReader class. D) DataInputStream. Show Answer Correct Answer: B) Console class. 18. Information stored on a storage device with a specific name is called as A) Folder. B) File. C) Module. D) Package. Show Answer Correct Answer: B) File. 19. Which class is used for reading data from a file in C++? A) 'ofstream'. B) 'ifstream'. C) 'fstream'. D) 'iostream'. Show Answer Correct Answer: B) 'ifstream'. 20. The first and second arguments of fopen() are A) Filename, mode. B) Mode, filename. C) File pointer. D) File point. Show Answer Correct Answer: A) Filename, mode. 21. A text file has the file extension of: A) .pdf. B) .txt. C) .doc. D) .text. Show Answer Correct Answer: B) .txt. 22. Select the correct order for processing a file. A) File object-Process-Type of file usage-Close file. B) Type of file usage-Process-File object-Close file. C) Type of file usage-File object-Process-Close file. D) Process-Type of file usage-File object-Close file. Show Answer Correct Answer: C) Type of file usage-File object-Process-Close file. 23. Why is a good idea to store data in text files? A) To provide permanent storage. B) So it can be accessed quickly. C) To improve the efficiency of associated programs. D) To reduce the amount of processing. Show Answer Correct Answer: A) To provide permanent storage. 24. Why is it important to always close files after handling them in PHP? A) To free up system resources. B) To delete the file. C) To move the file to another location. D) To encrypt the file. Show Answer Correct Answer: A) To free up system resources. 25. What does the 'r' mode signify when opening a file using fopen()? A) Create a text file for writing. B) Open a text file for reading. C) Create a binary file for writing. D) Open a binary file for reading. Show Answer Correct Answer: B) Open a text file for reading. ← 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