Professional Documents
Culture Documents
PROJECT 9-07-2021: #Ans To Ques 1
PROJECT 9-07-2021: #Ans To Ques 1
import pickle
def wi8dat():
global o
o=int(input("enter the no of rechords to be inputted===="))
for i in range (o):
y=int(input("enter the TNO of teacher-----"))
x=input("enter the name of teacher-----")
z=input("enter the sub of teacher-----")
f=int(input("enter the salary of teacher-----"))
lst=[y,x,z,f]
f=open("book11.dat","ab")
pickle.dump(lst,f)
f.close()
wi8dat()
1
[11]: #ans to ques no 2
def showdata():
f=open("book11.dat","rb")
for i in range(o):
y=pickle.load(f)
if y[3]<10000:
print("Details of teacher paid less than 10000")
print("TNO",y[0],"\n NAME",y[1],"\n SUB",y[2],"\n SALARY",y[3])
else:
continue
[12]: showdata()
2
enter the eNO of employee-----3
enter the name of employee-----TEZZ KAAM
enter the sub of department-----HOSPITAL
enter the salary of employ-----16000
[19]: showdata1()
def efg():
global o
o=int(input("enter the no of rechords to be inputted===="))
for i in range (o):
y=int(input("enter the addmission no-----"))
x=input("enter the name of student----")
f=int(input("enter the presentage of student-----"))
lst=[y,x,f]
f=open("student.dat","ab")
pickle.dump(lst,f)
f.close()
efg()
3
enter the name of student----LAKHAN
enter the presentage of student-----86
enter the addmission no-----9211
enter the name of student----VEERU
enter the presentage of student-----75
enter the addmission no-----524
enter the name of student----RISHI
enter the presentage of student-----55
enter the addmission no-----478
enter the name of student----KRISHNA KUMAR
enter the presentage of student-----87
[23]: OP_()
[ ]: