I'm trying to get this function to return "****** * * *********" (not a finished product obviously, just trying to figure out how it works step by step), but this code just returns the text without replacing anything. The way I see it, it should be checking every value in the string "Text" and then for every value, replace that value, i, with an asterisk. Where am I going wrong here?
def censor(text, word):
for i in text:
text.replace(i, '*')
return text
print censor("Hello, you are beautiful", "beautiful")