Professional Documents
Culture Documents
SNO Name of The Experiment Date of Experiment: Page No. 1
SNO Name of The Experiment Date of Experiment: Page No. 1
Experiment
15 WRITE A PYTHON PROGRAM TO IMPLEMENT A MENU DRIVEN
PROGRAM TO READ AND WRITE INTO A BINARY FILE
PROGRAM 15
Page No. 1
PROGRAM:
OUTPUT
Page No. 2
PROGRAM 16
PROGRAM:
Page No. 3
OUTPUT:
PROGRAM 17:
PROGRAM:
Page No. 5
OUTPUT:
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:
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:
Page No. 9
Page No. 10
Page No. 11
OUTPUT:
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:
PROGRAM:
Page No. 14
Page No. 15
OUTPUT:
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:
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:
Page No. 20
PROGRAM:
Page No. 21
OUTPUT:
Page No. 22
Page No. 23