Question
I need help writing a censor program (python) that first reads a file with bad words such as sex, drugs, C++, and so on, places
I need help writing a censor program (python) that first reads a file with bad words such as sex, drugs, C++, and so on, places them in a set, and then reads an arbitrary text file. The program should write the text to a new text file, replacing each letter of any bad word in the text with an asterisk.
Think about what the program needs to do ... for instance
Read a file with a list of "bad" words (you will need to create this - do not be vulgar)
Save words to a set
Read a second text file (copy an email and/or story)
Compare words of the second file to the words in the set
If the words match - replace the characters of the bad word with an asterisk
Write censored text to a new file
Write pseudocode for yourself to walk through what the program needs to do
Create the 2 text files needed for the program
Write the code as dictated by the pseudocode
Test
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started