Can anyone help me understand were I went wrong?
I know that exists a compact code, that solves this exercise.
But I only want to know were my line of thought went wrong.
It loops forever.
def censor(text, word): if word in text: x=len(word) for letter in word: while x>=0: censored_word=word.replace(letter, '*') new_text=text.replace(word, censored_word) x=x-1 return new_text