Censor Dispenser Part Three (email two)

This is relating to the function I created called “def censor_two.” I am having trouble censoring all the proprietary_terms from the email. It only censors the last word “herself.” It seems to me that it censors all the words each time but does not save the changes to the email_two. It only saves the changes for the last word “herself”.

Thank you

I was able to figure it out what happend. I guess what happened was it kept reading the original email_two file but only saved the censored on the last word which is “herself.” To fix this, I created a new variable and saved the email_two to it. Then I used the .replace() on the new variable and it worked. I guess the new variable “censored_email” kept all the changes.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.