Hello guys, I would appreciate some advice on how to return the proper text.
It looks like program is working fine, except I am not able to return the "outcome".
Here is my code:
def censor(text, word): length = len(word) xxx = text.split() new_string = "" for x in xxx: if x == word: print ("*" * length) + "".join(new_string), continue else: print "".join(new_string) + x, return new_string
word = "hey"
text = "hey hey hey"
print censor(text, word)