Sunday, 31 May 2026

PRACTICAL 7: TEXT FILES

 WAP to create functions that work on 'essay.txt' :

1. Accept an essay on nature and store it in the file. Display the Content of the file

2. Display the file and the number of times the word 'nature' occurs.(any case)

3. Make a new file green.txt to have all the lines that contain the word 'green'.Display the file

4. Change all the occurrences of 'nature/Nature' to NATURE. 

5. Add an extra paragraph to the essay.

6. Exit