Read the code given below and answer the question:
If the file contains “GOOD” before execution, what will be the contents of the file after execution of this code?
What will be the output of 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('text.dat','wb') as f: pickle.dump(lst,f) with open('text.dat','rb') as f: nlist= pickle.load(f) print(nlist)
Your recipe uses some ingredients. write a program to store the list of ingredients in a binary file.
Write a program to increase the salary by Rs. 2000/- of the employee having empno 1251 in the file empl.dat.
Consider the following definition of dictionary Multiplex, write a function in python to search and display all the contents in a pickled file cinema.dat, where Mtype key of the dictionary is matching with the value ‘Comedy’.