You are at a restaurant eating lunch with a friend. After the meal, your friend realizes they left their wallet at home. Your friend gives you a piece of silver….
write a program that redacts all occurrences of sensitive words in a text file by replacing them with asterisks.
Sensitive information is often removed, or redacted, from documents before they are released to the public. When the documents are released it is common for the redacted text to be replaced with black bars. In this exercise you will write a program that redacts all occurrences of sensitive words in a text file by replacing them with asterisks. Your program should redact sensitive words wherever they occur, even if they occur in the middle of another word. The list of sensitive words will be provided in a separate text file. Save the redacted version of the original text in a new file. The names of the original text file, sensitive words file, and redacted file will all be provided by the user.
You may find the replace method for strings helpful when completing this exercise. Information about the replace method can be found on the Internet. For an added challenge, extend your program so that it redacts words in a case insensitive manner. For example, if exam appears in the list of sensitive words then redact exam, Exam, ExaM and EXAM, among other possible capitalizations.