VIVA QUESTIONS-1
VIVA QUESTIONS-1
VIVA QUESTIONS-1
58. What are negative indexes and why are they used?
Ans: The sequences in Python are indexed and it consists of the positive as well as negative numbers. The
numbers that are positive uses ‘0’ that is uses as first index and ‘1’ as the second index and the process goes on
like that.
The index for the negative number starts from ‘-1’ that represents the last index in the sequence and ‘-2’ as the
penultimate index and the sequence carries forward like the positive number.
The negative index is used to remove any new-line spaces from the string and allow the string to except the last
character that is given as S[:-1]. The negative index is also used to show the index to represent the string in correct
order.
35. Is python case sensitive?
Ans: Yes. Python is a case sensitive language.
What is pickling?
Pickling refers to the process of converting python object hierarchy into a byte stream to write into a binary file.
What is unpickling?
It is the process of converting the byte stream back into an object hierarchy.
Which module is required to handle binary files?
pickle
Name the functions used to read and write data into binary files.
pickle.dump(list_object, file_handle)
pickle.load(file_object)