Python File Handling
- Class 12 Computer Science File Handling in Python MCQs Set 1
- Class 12 Computer Science File Handling in Python MCQs Set 2
- Class 12 Computer Science File Handling in Python MCQs Set 3
- Class 12 Computer Science File Handling in Python MCQs Set 4
- Class 12 Computer Science File Handling in Python MCQs Set 5
- Class 12 Computer Science File Handling in Python MCQs Set 6
- Class 12 Computer Science File Handling in Python MCQs Set 7
- Class 12 Computer Science File Handling in Python MCQs Set 8
- Class 12 Computer Science File Handling in Python MCQs Set 9
File Handling in Python MCQ’s Set – 2
Multiple Choice Questions
21. Which of the following is a valid example of CSV file content?
a) Best Website for Computer Science Term 1 Examination is mycstutorial.in.
b) Best → Website → for → Computer → Science → Term 1 → Examination → is → mycstutorial.in.
c) Best, Website, for, Computer, Science, Term 1, Examination, is, mycstutorial.in.
d) All of these
22. Which of the following is not a valid text file.
a) .ini files
b) .rtf files
c) .docx files
d) None of these
23. A _________ files stored the information in the form of a stream (sequence) of bytes.
a) text files
b) binary files
c) Both (a) and (b)
d) None of these
24. _________ files are human readable.
a) text files
b) binary files
c) Both (a) and (b)
d) None of these
25. _________ files are not human redable.
a) text files
b) binary files
c) Both (a) and (b)
d) None of these
26. A _________ files contain information in the same format in which the information held in computer memory.
a) text files
b) binary files
c) Both (a) and (b)
d) None of these
27. Tanmay is trying to open the binary file using a text editor will shows ________ value.
a) readable
b) garbage
c) proper
d) None of these
28. In _________ file, there is no delimiter in a line i.e. EOL.
a) text files
b) binary files
c) Both (a) and (b)
d) None of these
29. Identify the correct statement :-
I) Text File stores the information in human readable while binary does not.
II) In Text File internal translation occur while in binary file no translation occur.
III) Text file is faster than binary file.
a) I, II and III are true.
b) I & II are true only.
c) II and III are true only.
d) I and III are true only.
30. Files are mainly access for ____________.
a) read data
b) write data
c) Both (a) and (b)
d) None of these
31. Operations on files includes – .
a) Creating and Opening a File
b) Reading from file and Writing into a file
c) Deleting and Traversing from a file
d) All of these
32. Which module of Python contains different functions for handling files?
a) io
b) in_out
c) files
d) None of these
33. In Python, Which function is use to open the file?
a) open_file()
b) file_open()
c) open( )
d) None of these
34. Which of the following is a valid method to use the open() function?
a) fileobject = open(“filename”)
b) fileobject = open(“filename”, “filemode”)
c) Both (a) and (b)
d) None of these
35. What is the default mode i.e. file mode in open() function?
a) read
b) write
c) append
d) None of these
36. Write a valid command to open a file named -“student.txt” in read mode?
a) fileObject = open()
b) fileobject = open.open(“student.txt”)
c) fileobject = open(“student.txt”, “r”) OR fileobject = open(“student.txt”)
d) None of these
37. A File object is also known as _________.
a) Controller
b) File Handle
c) File Cursor
d) None of these
38. Amit has written this statement : fileobject = open(“amit.txt”, “r”). What happen if the file “amit.txt” is not exists in the current folder.
a) Python will create a new file named “amit.txt”
b) Raise an error : FileNotFoundError
c) Does nothing
d) None of these
39. fileobject = open(“mycstutorial.txt”) .
In the given statement, what is the use of fileobject?
a) fileobject is a variable, helps to perform read and write operation with file.
b) fileobject is a variable only.
c) It stores the name of the file.
d) None of these
40. The ___________ establishes a link between the program and the data file stored in the permanent storage.
a) filemode
b) filename
c) fileobject
d) None of these
Python File Handling (MCQ’s)
- Class 12 Computer Science File Handling in Python MCQs Set 1
- Class 12 Computer Science File Handling in Python MCQs Set 2
- Class 12 Computer Science File Handling in Python MCQs Set 3
- Class 12 Computer Science File Handling in Python MCQs Set 4
- Class 12 Computer Science File Handling in Python MCQs Set 5
- Class 12 Computer Science File Handling in Python MCQs Set 6
- Class 12 Computer Science File Handling in Python MCQs Set 7
- Class 12 Computer Science File Handling in Python MCQs Set 8
- Class 12 Computer Science File Handling in Python MCQs Set 9
Python Revision Tour – Multiple Choice Questions (MCQ’s)
- Class 12 Computer Science MCQs Python Revision Tour Set – 1
- Class 12 Computer Science MCQs Python Revision Tour Set – 2
Python Functions – Working with Functions (MCQ’s)
- Class 12 Computer Science Python Functions – Working with Functions MCQs Set – 1
- Class 12 Computer Science Python Functions – Working with Functions MCQs Set – 2
- Class 12 Computer Science Python Functions – Working with Functions MCQs Set – 3
- Class 12 Computer Science Python Functions – Working with Functions MCQs Set – 4
- Class 12 Computer Science Python Functions – Working with Functions MCQs Set – 5
- Class 12 Computer Science Python Functions – Working with Functions MCQs Set – 6