I’m looking for some guidance. I’m currently trying to finish this project but i’m stuck on part 5.
" This final email has Mr. Cloudy in a frenzy. “We can’t let this information get out!” He tells you, “our company would be ruined! Censor it! Censor it all!”
Write a function that censors not only all of the words from the
proprietary_terms lists, but also censor any words in
email_four that come before AND after a term from those two lists."
so i got both lists of ‘negative_words’ and ‘proprietary_terms’ to come censored on the output but now i’m stuck on how to move forward on “but also censor any words in
email_four that come before AND after a term from those two lists.”
def censor_it_all(proprietary_terms=proprietary_terms, negative_words=negative_words, email_four=email_four): index=0 for word in proprietary_terms: if word in email_four: #and (word in proprietary_terms): email_four = email_four.replace(word, 'REDACTED') continue for word1 in negative_words: if word1 in email_four: #and (word in proprietary_terms): email_four = email_four.replace(word1, 'REDACTED') #return email_four print(email_four.find('REDACTED')) print(censor_it_all())
I wanted to move forward using the .find function but don’t know how. I can’t imagine having to put in each term separately to find the index. I feel like I’m close but tell me if I’m not.