Q. What will be displayed by the following code ?
import pickle
Names = ["First", "second", 'third', 'fourth', 'Fifth']
lst = []
for i in range(-1, -5, -1):
lst.append(Names[i])
with open("test.dat", 'wb') as fout:
pickle.dump(lst, fout)
with open("test.dat", 'rb') as fin:
nlist = pickle.load(fin)
print(nlist)
Answer :-
['Fifth', 'fourth', 'third', 'second']
>>>
Post a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )