Considering the following definition of class FACTORY, write a method in Python to search and display the content in a pickled file FACTORY.DAT,where FCTID is matching with the value '105'.
class Factory:
def __init__(self,FID,FNAM):
self.FCTID = FID # FCTID Factory ID
self.FCTNM = FNAM # FCTNM Factory Name
self.PROD = 1000 # PROD Production
def Display(self):
print self.FCTID,':',self.FCTNM,':',self.PROD
import pickle
def ques4c( ):
f=Factory( )
file=open('FACTORY.DAT','rb')
try:
while True:
if=pickle.load(file)
if f.FCTID==105:
f.Display()
except EOF Error:
pass
file.close()