0% found this document useful (0 votes)
8 views2 pages

Python Pickle Employee and Student Records

Uploaded by

mbrspo
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

Python Pickle Employee and Student Records

Uploaded by

mbrspo
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

36.

(I)

import pickle
def countrec(file_name):
f1 = open(file_name, 'rb')
while True:
try:
employees = [Link](f1)
for employee in employees:
if (employee[2] > 89000):
print("Employee ID:", employee[0], "Name:",
employee[1], "Salary:", employee[2])
except EOFError:
break
[Link]()
countrec("[Link]")

36. (II)

import pickle
def countrec():
fobj=open("[Link]","rb")
num = 0
try:
while True:
rec=[Link](fobj)
if rec[2]>90:
num = num + 1
print(rec[0],rec[1],rec[2])
except:
[Link]()
return num

You might also like