Skip to content

Commit 2e5c08d

Browse files
committed
add 0012
1 parent 338a70c commit 2e5c08d

2 files changed

Lines changed: 37 additions & 0 deletions

File tree

‎llluiop/0012/filtered_words.txt‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
����
2+
����Ա
3+
����Ա
4+
�쵼
5+
ţ��
6+
ţ��
7+
����
8+
����
9+
love
10+
sex
11+
jiangge

‎llluiop/0012/replacefilterwords.py‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env python
2+
3+
import os
4+
5+
6+
7+
def Words(path):
8+
filterwords = []
9+
f = open(path)
10+
for word in f.readlines():
11+
filterwords.append(word.strip('\n'))
12+
13+
return filterwords
14+
15+
16+
if __name__ == '__main__':
17+
filteredwords = Words('filtered_words.txt')
18+
19+
while(True):
20+
input = raw_input("input your line:")
21+
22+
for word in filteredwords:
23+
if word in input:
24+
input = input.replace(word, ''.join(['*' for x in range(len(word))]))
25+
26+
print input

0 commit comments

Comments
 (0)