Skip to content

Commit 0026ee4

Browse files
unknownunknown
unknown
authored and
unknown
committed
1 parent c835b1a commit 0026ee4

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

hooting/0011/0011.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
# -*- coding: utf-8 -*-
22
__author__ = 'hooting'
33
with open('filtered_words.txt','r')as f:
4-
data = f.read()
5-
6-
filter = data.split('\n')
4+
filter = [line.rstrip() for line in f]
75

86
while True:
97
text = raw_input("please input:")

hooting/0012/0012.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# -*- coding: utf-8 -*-
2+
__author__ = 'hooting'
3+
with open('filtered_words.txt','r')as f:
4+
filter = [line.rstrip() for line in f]
5+
6+
while True:
7+
text = raw_input("please input:")
8+
for x in filter:
9+
if x in text:
10+
print len(x)
11+
text = text.replace(x, '*'*len(x))
12+
print text

hooting/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

0 commit comments

Comments
 (0)