Ex No: 19 | File Handling Operations |
---|---|
Aim: | To write a python program to perfrom File Handling Operations. |
Algorithm | |
Step1: Get Student names in a list and enter 'quit' to exit. | |
Step2: Sort the list using sort() function. | |
Step3: Open 'studlist.txt' file in write ('w') mode. | |
Step4: Write the names from the list into file with roll number and close the file. | |
Step5: Open 'studlist.txt' file in read ('r') mode. | |
Step6: Using for loop display each line in the file one by one. | |
Source Code | |
|
|
Result: | Thus a python program is written to perform file operations. |