You are on page 1of 4

PROJECT 9-07-2021

July 10, 2021

[10]: #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()

enter the no of rechords to be inputted====5


enter the TNO of teacher-----1
enter the name of teacher-----ANUJ
enter the sub of teacher-----MATHEMATICS
enter the salary of teacher-----15000
enter the TNO of teacher-----2
enter the name of teacher-----AAKASH
enter the sub of teacher-----SST
enter the salary of teacher-----11000
enter the TNO of teacher-----3
enter the name of teacher-----PRAGATI
enter the sub of teacher-----HISTORY
enter the salary of teacher-----8000
enter the TNO of teacher-----4
enter the name of teacher-----ANUSHKA
enter the sub of teacher-----GK
enter the salary of teacher-----14000
enter the TNO of teacher-----5
enter the name of teacher-----KOMILA
enter the sub of teacher-----ENG
enter the salary of teacher-----100

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()

Details of teacher paid less than 10000


TNO 3
NAME PRAGATI
SUB HISTORY
SALARY 8000
Details of teacher paid less than 10000
TNO 5
NAME KOMILA
SUB ENG
SALARY 100

[17]: #ans to ques 3


def wi8dat1():
global o
o=int(input("enter the no of rechords to be inputted===="))
for i in range (o):
y=int(input("enter the eNO of employee-----"))
x=input("enter the name of employee-----")
z=input("enter the sub of department-----")
f=int(input("enter the salary of employ-----"))
lst=[y,x,z,f]
f=open("book12.dat","ab")
pickle.dump(lst,f)
f.close()
wi8dat1()

enter the no of rechords to be inputted====3


enter the eNO of employee-----1
enter the name of employee-----RAJU TAKLE
enter the sub of department-----SANICHARI HILLS
enter the salary of employ-----8000
enter the eNO of employee-----6
enter the name of employee-----SAKSHAM
enter the sub of department-----WEDDING
enter the salary of employ-----36000

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

[18]: #ans to ques no 4


def showdata1():
f=open("book12.dat","rb")
for i in range(o):
y=pickle.load(f)
if y[0]<5:
print("Details of employee whose eNO is less than 5")
print("eNO",y[0],"\n NAME",y[1],"\n DEPRT",y[2],"\n SALARY",y[3])
else:
continue

[19]: showdata1()

Details of employee whose eNO is less than 5


eNO 1
NAME RAJU TAKLE
DEPRT SANICHARI HILLS
SALARY 8000
Details of employee whose eNO is less than 5
eNO 3
NAME TEZZ KAAM
DEPRT HOSPITAL
SALARY 16000

[21]: #ANSWER TO QUES 5

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()

enter the no of rechords to be inputted====5


enter the addmission no-----124
enter the name of student----RIYA
enter the presentage of student-----74
enter the addmission no-----421

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

[22]: def OP_():


f=open("student.dat","rb")
j=0
for i in range(o):
y=pickle.load(f)
if y[2]<75:
j+=1
print("Details of student whose % is less than 75")
print("adNO",y[0],"\n NAME",y[1],"\n %",y[2])
else:
continue
print("no of students scoring above 75 are",o-j)

[23]: OP_()

Details of student whose % is less than 75


adNO 124
NAME RIYA
% 74
Details of student whose % is less than 75
adNO 524
NAME RISHI
% 55
no of students scoring above 75 are 3

[ ]:

You might also like