Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def censorship(inputstring):
- bannedwords = ['tits','tit','titties']
- splitstring = inputstring.lower().split(' ')
- for b in range(len(splitstring)):
- if splitstring[b] in bannedwords:
- splitstring[b] = "X"*len(splitstring[b])
- a = ' '.join(splitstring)
- return a
- inputstring = str(raw_input('Type in the evil sentence >'))
- print "\n\n",censorship(inputstring)
- """ If you can't handle reading certain words in your mail
- just add them to the bannedwords list
- """
Advertisement
Add Comment
Please, Sign In to add comment