Advertisement
simeonshopov

Text Filter

Feb 10th, 2020
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. banned_words = input().split(', ')
  2. text = input()
  3.  
  4. for banned in banned_words:
  5.     while True:
  6.         if banned not in text:
  7.             break
  8.         else:
  9.             length = len(banned)
  10.             text = text.replace(banned, '*' * len(banned))
  11.  
  12. print(text)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement