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 – 7
Multiple Choice Questions
121. The full name of a file or a directory is also called ________.
a) folder name
b) path
c) pathname
d) None of these
122. The _____ are from the topmost level of the directory structure.
a) absolute paths
b) relative paths
c) absolute and relative paths
d) None of these
123. The _____ are relative to current working directory.
a) absolute paths
b) relative paths
c) absolute and relative paths
d) None of these
124. The ______ is use to represent the current working directory.
a) single dot (.)
b) double dot (..)
c) Both (a) and (b)
d) None of these
125. The ______ is use to represent the current working directory.
a) single dot (.)
b) double dot (..)
c) Both (a) and (b)
d) None of these
Directions (Question Number 126 and 127) : Answer the following question on the basis of given figure. Note: Tom is in c:\
126. Write single line statement to open the “one.txt” file in read mode using absolute path.
a) f = open(“one.txt”, “r”)
b) f = open(“c:\\tom\\data\one.txt, “r”)
c) f = open(“..\\data\one.txt, “r”)
d) None of these
127. Write single line statement to open the “one.txt” file in read mode using relative path.
a) f = open(“one.txt”, “r”)
b) f = open(“c:\\tom\\data\one.txt, “r”)
c) f = open(“..\\data\one.txt, “r”)
d) None of these
128. Which module is required in Python, to perform read and write operation with Binary file?
a) random
b) pickle
c) binary
d) None of these
129. Identify the valid statement to import the pickle module.
a) import pickles;
b) from import pickle
c) import pickle
d) None of these
130. What is Pickling?
a) converting tuples to byte stream
b) converting list to byte stream
c) converting dictionary to byte stream
d) All of these
131. What is Serialisation?
a) converting tuples to byte stream
b) converting list to byte stream
c) converting dictionary to byte stream
d) All of these
132. Serialisation is also known as _______.
a) Pickling
b) Unpickling
c) Byte Stream
d) All of these
133. What is Unserialization / unpickling?
a) byte stream converting to tuples
b) converting byte stream to python object
c) converting byte stream to dictionary
d) All of these
134. Which method of pickle module is use to write an object on to a binary file?
a) write( )
b) load( )
c) dump( )
d) None of these
135. Which method of pickle module is use to read from a binary file?
a) write( )
b) load( )
c) dump( )
d) None of these
136. Identify which one is the valid syntax of dump() method?
a) dump(python_object, file_handle)
b) dump(file_handle, python_object)
c) pickle.dump(file_handle, python_object)
d) pickle.dump(python_object, file_handle)
137. Identify which one is the valid syntax of load() method?
a) python_object = load(file_handle)
b) python_variable_object = pickle.load(file_handle)
c) variable = pickle.load(file_handle, python_object)
d) None of these
138. Which one is the not a valid file mode for binary file?
a) r
b) rb
c) wb
d) ab
139. Which one is the not a valid file mode for binary file?
a) rb+
b) wb+
c) w+
d) ab+
140. Which one is the not a valid file mode for binary file?
a) r+b
b) a+
c) w+b
d) a+b
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
Thanks for visiting. Online Classes are available.