gs gs109 Python Modules - Python Pickle Module - Quiz No.1
gs gs109 Python Quiz
This quiz belongs to book/course code gs gs109 Python of gs organization. We have 134 quizzes available related to the book/course Python. This quiz has a total of 10 multiple choice questions (MCQs) to prepare and belongs to topic Python Modules. NVAEducation wants its users to help them learn in an easy way. For that purpose, you are free to prepare online MCQs and quizzes.
NVAEducation also facilitates users to contribute in online competitions with other students to make a challenging situation to learn in a creative way. You can create one to one, and group competition on an topic of a book/course code. Also on NVAEducation you can get certifications by passing the online quiz test.
Question 1: The process of pickling in Python includes:
conversion of a list into a datatable
conversion of a byte stream into Python object hierarchy
conversion of a Python object hierarchy into byte stream
conversion of a datatable into a list
Question 2: To sterilize an object hierarchy, the _____________ function must be called. To desterilize a data stream, the ______________ function must be called.
dumps(), undumps()
loads(), unloads()
loads(), dumps()
dumps(), loads()
Question 3: Pick the correct statement regarding pickle and marshal modules.
The pickle module supports primarily .pyc files whereas marshal module is used to sterilize Python objects
The pickle module keeps track of the objects that have already been sterilized whereas the marshal module does not do this
The pickle module cannot be used to sterilize user defined classes and their instances whereas marshal module can be used to perform this task
The format of sterilization of the pickle module is not guaranteed to be supported across all versions of Python. The marshal module sterilization is compatible across all the versions of Python
Question 5: Which of the following Python codes will result in an error?
object = ‘a’
>>> pickle.dumps(object)
>>> pickle.dumps(object, 3)
>>> pickle.dumps(object, 3, True)
>>> pickle.dumps(‘a’, 2)
Question 6: Which of the following functions can be used to find the protocol version of the pickle module currently being used?
pickle.DEFAULT
pickle.CURRENT
pickle.CURRENT_PROTOCOL
pickle.DEFAULT_PROTOCOL
Question 8: Which of the following functions can accept more than one positional argument?
pickle.dumps
pickle.loads
pickle.dump
pickle.load
Question 9: Which of the following functions raises an error when an unpicklable object is encountered by Pickler?
pickle.PickleError
pickle.PicklingError
pickle.UnpickleError
pickle.UnpicklingError