CBSE BOARD XII, asked by himadriprasad10826, 1 month ago

Write a python program to search and display the record of the student from a binary file “Student.dat” containing students records (Rollno, Name and Marks). Roll number of the student to be searched will be entered by the user​

Answers

Answered by mayanksaha9125
4

Answer:

import pickle

def addrec():

   fobj=open("student.dat","ab")

   rollno=int(input("Roll Number : "))

   sname=input("Student Name :")

   rec=[rollno,sname]

   pickle.dump(rec,fobj)

fobj.close()

addrec()

Explanation:

Similar questions