fork(1) download
  1. def censor(text, word):
  2. text = text.split()
  3. censored_text = ''
  4. number = len(word)
  5. for i in text:
  6. print i
  7. if i == word:
  8. "*".join(censored_text) * number
  9. else:
  10. i.join(censored_text)
  11. return censored_text
  12. print censor("pidar Illya poshel nahui", "nahui")
Success #stdin #stdout 0.09s 8856KB
stdin
Standard input is empty
stdout
pidar
Illya
poshel
nahui