We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 40aa690 commit 61cd5b7Copy full SHA for 61cd5b7
1 file changed
pylyria/0012/0012.py
@@ -0,0 +1,18 @@
1
+# -*- coding: utf-8 -*-
2
+#!/usr/bin/env python
3
+import re
4
+
5
+def sensitive_test(word):
6
+ sensitive_words = [line.strip() for line in open('sensitive.txt', encoding='utf-8')]
7
+ word = word.strip()
8
+ for sensitive_word in sensitive_words:
9
+ if sensitive_word.strip() in word.lower():
10
+ word = re.sub(sensitive_word, '*' * len(sensitive_word), word, flags=re.IGNORECASE)
11
+ return word
12
13
+if __name__ == "__main__":
14
+ line = True
15
+ while line:
16
+ line = input()
17
+ line = line.strip()
18
+ print(sensitive_test(line))
0 commit comments