Censor Despenser e-mail one

Hey all,

Just plucking away at the Censor Dispenser challenge project and I managed to hammer out the first e-mail with a bit of review/web digging.

My question is in regards to format, or to be more accurate, console output of my solution.

I’ve used
#CONVERTS EMAIL TO LIST, CENSORS AND STRIPS

def censor_file(body, target):

censored_mail =

for phrase in body:

censored_word = body.replace(target, "REDACTED").replace("\n", "")

censored_mail.append(censored_word)

return censored_mail

to produce the email with censorship in place. My question is once the string has been transferred to a list like this, is there a shorthand, or reasonably efficient method for that matter to revert the list into the previous format to help its readability?

Thanks for your time!

I think you are looking for something like this! https://www.w3schools.com/python/ref_string_join.asp