10/15 censor. Error while the code is functioning properly


#1

def censor(text, word):
output = ""
asterisks = len(word) * "*"
text_list = text.split()
for w in text_list:
if w == word:
output += asterisks + " "
else:
output += w + " "

return output

What do i do?


#2

You have a trailing space


#3

You are right I just saw it, thanks
I am gonna try to fix it