0% found this document useful (0 votes)
4 views

4.2 Program Sheet of Binary File Handling-1

The document outlines a series of Python programming tasks focused on handling binary files. Each task involves defining functions to read specific binary files and filter or display records based on given criteria, such as counting photos, filtering items by price, and searching for laptops. The tasks cover various data types including photos, items, toys, workers, vintage vehicles, and user statuses.

Uploaded by

Atharv Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

4.2 Program Sheet of Binary File Handling-1

The document outlines a series of Python programming tasks focused on handling binary files. Each task involves defining functions to read specific binary files and filter or display records based on given criteria, such as counting photos, filtering items by price, and searching for laptops. The tasks cover various data types including photos, items, toys, workers, vintage vehicles, and user statuses.

Uploaded by

Atharv Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

PROGRAM SHEET OF BINARY FILE HANDLINg

1. WAP to define a function “COUNTPICS() “ in python to read each object of a


binary file “PHOTOS.DAT” , find and display the total number of photos of type
PORTRAIT.

2. WAP to define a function “ECONOMIC()” in python to read each record of a


binary file ‘ITEMS.DAT’, find and display those items , which cost less than 2500 .
Assume that file contains record like: [Gift name , price].

3. Write a function in python to read the objects of toys from binary file
“TOYS.DAT” and meant for children age range “5 to 8”.Record like :[code, toy
name , age].

4. Write a function in python to read the objects of worker from binary file
named “WORKER.DAT” and display those records of workers whose wage is
less than 300.Record like : [Wno , Wname , Wage].

5. Write a function in python to read the objects of VINTAGE from binary file
“VINTAGE.DAT” and display those vintage vehicles , which are priced between
200000 and 250000.Record like : [Vno, Vname ,price].

6. Write a function in python “ SEARCH()” to search for a laptop from a binary


file “LAPTOP.DAT” . The user should enter the Modelno and the function should
search and display the details of the laptop . Record like [Modelno , Details].

7. Write a function in python to read and display the details of all the users
whose status is ‘A’ (i.e. Active) from a binary file “USER.DAT”. Record like
[Vid , Vname , status].

You might also like