#program to store multiple integer in binary file and read
"""def binfile(): import pickle file=open('data.dat','wb') while True: x=int(input("enter the integer:")) pickle.dump(x,file) ans=input('do you want to enter more data Y/N:') if ans.upper()=='N': break file.close() file=open('data.dat','rb') try: while True: y=pickle.load(file) print(y) except EOFError: pass binfile()""" #program for inserting/appending a record in a binary file- """import pickle record=[] while True: roll_no=int(input("Enter student roll no:")) name=input("Enter the student name:") marks=int(input("Enter the marks obtained:")) data=[roll_no,name,marks] record.append(data) choice=input("wish to enter more records (Y/N)?:") if choice.upper()=='N': break f=open("student","wb") pickle.dump(record, f) print("record added") f.close()"""