Class 12th CBSE CS
Write a program to search a record using its roll number and display the name of student. If record not found then display appropriate message.
Solution: –
import pickle roll = input('Enter roll number that you want to search in binary file :') file = open("student.dat", "rb") list = pickle.load(file) file.close( ) for x in list: if roll in x['roll']: print("Name of student is:", x['name']) break else: print("Record not found")

Fun & Easy to follow

Works on all devices

Your own Pace

Super Affordable
Popular Videos

UX for Teams
Learn the basics and a bit beyond to improve your backend dev skills.

Chris Matthews
Designer

SEO & Instagram
Learn the basics and a bit beyond to improve your backend dev skills.

Chris Matthews
Designer