Download as pdf or txt
Download as pdf or txt
You are on page 1of 23

SNO Name of the Experiment Date of

Experiment
15 WRITE A PYTHON PROGRAM TO IMPLEMENT A MENU DRIVEN
PROGRAM TO READ AND WRITE INTO A BINARY FILE

16 WRITE A PYTHON PROGRAM TO IMPLEMENT A MENU DRIVEN


PROGRAM TO SEARCH FOR A RECORD IN A BINARY FILE

17 WRITE A PYTHON PROGRAM TO IMPLEMENT A MENU DRIVEN


PROGRAM TO DELETE A PARTICULAR RECORD INTO A
BINARY FILE

18 WRITE A PYTHON PROGRAM TO IMPLEMENT A MENU DRIVEN


PROGRAM TO UPDATE A PARTICULAR RECORD INTO A
BINARY FILE

19 WRITE A PYTHON PROGRAM TO IMPLEMENT A MENU DRIVEN


PROGRAM TO PERFORM ALL THE OPERATIONS IN A BINARY
FILE USING DICTIONARY.

20 WRITE A PYTHON PROGRAM TO IMPLEMENT A MENU DRIVEN


PROGRAM TO READ AND WRITE INTO A CSV FILE

21 WRITE A PYTHON PROGRAM TO COUNT THE NUMBER OF


RECORDS IN A CSV FILE, ALSO SEARCH FOR A
PARTICULAR RECORD.

22 WRITE A PYTHON PROGRAM TO IMPLEMENT A MENU DRIVEN


PROGRAM TO DELETE A PARTICULAR RECORD INTO A
CSV FILE
23 WRITE A PYTHON PROGRAM TO IMPLEMENT A MENU DRIVEN
PROGRAM TO UPDATE A PARTICULAR RECORD INTO A
CSV FILE

PROGRAM 15

WRITE A PYTHON PROGRAM TO IMPLIMENT A MENU DRIVEN PROGRAM TO READ


AND WRITE INTO A BINARY FILE, ENTER STUDENTS ROLL NUMBER, NAME AND
MARK AS A LIST

Page No. 1
PROGRAM:

OUTPUT

Page No. 2
PROGRAM 16

WRITE A PYTHON PROGRAM TO IMPLIMENT A MENU DRIVEN PROGRAM TO SEARCH


A RECORD IN A BINARY FILE, ENTER THE STUDENT‟S ROLL NUMBER TO BE
SEARCHED.

PROGRAM:

Page No. 3
OUTPUT:

1. Display all the details


2. Search for a record
6. Exit
Enter the choice :1
[1, 'Diya', 45]
[2, 'Arun', 90]
1. Display all the details
2. Search for a record
6. Exit
Enter the choice :2
Enter the roll number to be searched:2
[2, 'Arun', 90]
1. Display all the details
2. Search for a record
6. Exit
Enter the choice :2
Page No. 4
Enter the roll number to be searched:5
No such record exist
1. Display all the details
2. Search for a record
6. Exit
Enter the choice :6

PROGRAM 17:

WRITE A PYTHON PROGRAM TO IMPLIMENT A MENU DRIVEN PROGRAM TO DELETE


A PARTICULAR RECORD INTO A BINARY FILE

PROGRAM:

Page No. 5
OUTPUT:

1. Display all the details


2. Delete a record
6. Exit
Enter the choice :1
[1, 'Diya', 45]
[2, 'Arun', 90]

Page No. 6
1. Display all the details
2. Delete a record
6. Exit
Enter the choice :2
Enter the roll number to be deleted:2
1. Display all the details
2. Delete a record
6. Exit
Enter the choice :1
[1, 'Diya', 45]
1. Display all the details
2. Delete a record
6. Exit
Enter the choice :2
Enter the roll number to be deleted:4
No such record
1. Display all the details
2. Delete a record
6. Exit
Enter the choice :6

PROGRAM 18:

WRITE A PYTHON PROGRAM TO IMPLIMENT A MENU DRIVEN PROGRAM TO UPDATE


A PARTICULAR RECORD INTO A BINARY FILE

PROGRAM:

Page No. 7
OUTPUT:
1. Display all the details
2. update a record
6. Exit
Enter the choice :1
[1, 'Diya', 45]
[2, 'Arjun', 78]
[3, 'Abhinav', 90]

Page No. 8
1. Display all the details
2. update a record
6. Exit
Enter the choice :2
Enter the roll number to be updated:2
Enter the new nameSurya
Enter the new marks55
1. Display all the details
2. update a record
6. Exit
Enter the choice :1
[1, 'Diya', 45]
[2, 'Surya', 55]
[3, 'Abhinav', 90]
1. Display all the details
2. update a record
6. Exit
Enter the choice :6
PROGRAM 19:

WRITE A PYTHON PROGRAM TO IMPLEMENT A MENU DRIVEN PROGRAM TO PERFORM


ALL THE OPERATIONS IN A BINARY FILE USING DICTIONARY.
PROGRAM:

Page No. 9
Page No. 10
Page No. 11
OUTPUT:

1.Write into the file


2.Display the contents of a file
3.Search using name
4.Delete using EID
5.Update using EID
6.Exit
Enter your choice1
Enter the EID:101
Enter the name:Sam
Enter the Salary:5500
1.Write into the file
2.Display the contents of a file
3.Search using name
4.Delete using EID
5.Update using EID
6.Exit
Enter your choice1
Enter the EID:102
Enter the name:Steve

Page No. 12
Enter the Salary:7800
1.Write into the file
2.Display the contents of a file
3.Search using name
4.Delete using EID
5.Update using EID
6.Exit
Enter your choice2
{'EID': 101, 'Name': 'Sam', 'Sal': 5500}
{'EID': 102, 'Name': 'Steve', 'Sal': 7800}
1.Write into the file
2.Display the contents of a file
3.Search using name
4.Delete using EID
5.Update using EID
6.Exit
Enter your choice3
Enter the name to be searched:Steve
{'EID': 102, 'Name': 'Steve', 'Sal': 7800}
1.Write into the file
2.Display the contents of a file
3.Search using name
4.Delete using EID
5.Update using EID
6.Exit
Enter your choice5
Enter the record to be updated:102
enter the new nameDeepika
Enter the new salary500
{'EID': 102, 'Name': 'Deepika', 'Sal': 500}
1.Write into the file
2.Display the contents of a file
3.Search using name
4.Delete using EID
5.Update using EID
6.Exit
Enter your choice2
{'EID': 101, 'Name': 'Sam', 'Sal': 5500}
{'EID': 102, 'Name': 'Deepika', 'Sal': 500}
1.Write into the file
2.Display the contents of a file
3.Search using name
4.Delete using EID
5.Update using EID
6.Exit
Enter your choice4
Enter the EID to be deleted:102
Page No. 13
1.Write into the file
2.Display the contents of a file
3.Search using name
4.Delete using EID
5.Update using EID
6.Exit
Enter your choice2
{'EID': 101, 'Name': 'Sam', 'Sal': 5500}
1.Write into the file
2.Display the contents of a file
3.Search using name
4.Delete using EID
5.Update using EID
6.Exit
Enter your choice6

PROGRAM 20:

WRITE A PYTHON PROGRAM TO IMPLIMENT A MENU DRIVEN PROGRAM TO READ


AND WRITE INTO A CSV FILE

PROGRAM:

Page No. 14
Page No. 15
OUTPUT:

1.Write into the file


2.Display the record
6.exit
Choice1
CID:1
Name:CD1
Price76
1.Write into the file
2.Display the record
6.exit
Choice1
CID:2
Name:CD2
Price90
1.Write into the file
2.Display the record
6.exit
Choice2
['CID', 'NAME', 'PRICE']
['1', 'CD1', '76']
['2', 'CD2', '90']
1.Write into the file
2.Display the record
6.exit
Choice:6

PROGRAM 21:
PROGRAM TO COUNT THE NUMBER OF RECORDS IN THE CSV FILE AND SEARCH

Page No. 16
FOR A PARTICULAR RECORD IN THE FILE

PROGRAM:

Page No. 17
OUTPUT:

1.Display the record


2.Search for a record
6.exit
Choice1
['CID', 'NAME', 'PRICE']
['1', 'CD1', '89']
['2', 'CD2', '75']
['3', 'CD3', '150']
The number of records= 3
1.Display the record
2.Search for a record
6.exit
Choice2
Enter CID to be searched2
['2', 'CD2', '75']
1.Display the record
2.Search for a record
6.exit
Choice2
Enter CID to be searched9
No such record
1.Display the record
2.Search for a record
6.exit
Choice6

Page No. 18
PROGRAM 22:
WRITE A PYTHON PROGRAM TO IMPLEMENT A MENU DRIVEN PROGRAM TO DELETE
A PARTICULAR RECORD INTO A CSV FILE.
PROGRAM:

Page No. 19
OUTPUT:

1.Display the record


2.Delete a record
6.exit
Choice1
['CID', 'NAME', 'PRICE']
['1', 'CD1', '89']
['2', 'AB1', '100']
['3', 'CD3', '150']
1.Display the record
2.Delete a record
6.exit
Choice2
Enter CID to be deleted6
No such record
1.Display the record
2.Delete a record
6.exit
Choice2
Enter CID to be deleted2
1.Display the record
2.Delete a record
6.exit
Choice1
['CID', 'NAME', 'PRICE']
['1', 'CD1', '89']
['3', 'CD3', '150']
1.Display the record
2.Delete a record
6.exit
Choice 6
PROGRAM 23:
WRITE A PYTHON PROGRAM TO IMPLEMENT A MENU DRIVEN PROGRAM TO UPDATE
A PARTICULAR RECORD INTO A CSV FILE.

Page No. 20
PROGRAM:

Page No. 21
OUTPUT:

1.Display the record


2.Update a record
6.exit
Choice1
['CID', 'NAME', 'PRICE']
['1', 'CD1', '89']
['2', 'CD2', '75']
['3', 'CD3', '150']
1.Display the record
2.Update a record
6.exit
Choice2
Enter CID to be updated2
Enter the new nameAB1
Enter the new price100
1.Display the record
2.Update a record
6.exit
Choice1
['CID', 'NAME', 'PRICE']
['1', 'CD1', '89']
['2', 'AB1', '100']
['3', 'CD3', '150']
1.Display the record
2.Update a record
6.exit
Choice 6

Page No. 22
Page No. 23

You might also like