Binary file update using Python program
#Create a binary file with roll number, name and marks. Input a roll number and update the marks. import pickle def write(): stud=[] f=open("test.dat","wb") ans='y' while ans.lower()=='y': rollno=int(input("Enter Roll No:")) name=input("Enter Name:") marks=int(input("Enter Marks:")) stud.append([rollno,name,marks]) ans=input("Add more records?(y)") pickle.dump(stud,f) f.close() def update(): found=False f = open("test.dat","rb+") n=int(input("enter roll number:")) try: while True: rpos=f.tell() stu=pickle.load(f) if stu[0][0]==n: ...