A binary file contains name , Roll no, marks of students. Read the content of the file and print the following

# """ A binary file contains name , Roll no, marks of students. Read the content of the file and print the following . # i) no of students securing marks from 0-20 # ii) no of students securing marks from 21-50 # iii) no of students securing marks above 50 # iv) the student detail with lowest mark # v) the student detail with highest mark""" #program start import pickle fh=open('student.dat',"wb+") c2051=c50=c021=mx=0 mn=5268 try: while True: ob=pickle.load(fh) if 050: c50+=1 if ob[2]>mx: mx=ob[2] if ob[2]

Comments