Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def censor(text,word):
- text = text.split()
- new_text = ""
- for item in text:
- if word == item:
- for i in item:
- new_text += "*"
- new_text += " "
- else:
- new_text += "%s " % item
- return new_text
- print censor("hey holla hey hey","hey")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement