Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def censor(text, word):
- result = ""
- text = text.split()
- for c in text:
- if c == word:
- c = "*" * len(word)
- result = result + ' ' + c
- return result
- print censor("hey hey hey", "hey")
- Oops, tente outra vez. Sua funcao falha em censor("hey hey hey","hey"). Ela retorna " *** *** ***" quando deveria retornar "*** *** ***".
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement