Write a function "main" that removes all the occurrencesof a specified string from a text file. Your program shouldprompt the user to enter a string to be removed froma file.
You can use the file with nametest6.txt
Your program should count the words before removing andafter removing the keyword.
Use the message exactly like the samplerun.
Here is a sample run:
<Output>
Enter a keyword to be removed: you
Word count before removing the keyword: 601
count number of you in the text: 10
Word count after removing the keyword: 591
<End Output>
test:
Write a function "main" that removes all the occurrences of a specified string from a text file. Your program should pro
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am