Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Demystified

Authors: Andrew Oppel

1st Edition

0072253649, 9780072253641

More Books

Students also viewed these Databases questions

Question

a. What is the purpose of the team?

Answered: 1 week ago

Question

How wide are Salary Structure Ranges?

Answered: 1 week ago