Skip to content

Commit 52b5da0

Browse files
author
XiaomingSu
committed
word filter
1 parent b1429c4 commit 52b5da0

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

PyBeaner/0012/filter.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
__author__ = 'PyBeaner'
2+
words = open("filtered_words.txt").read().split()
3+
4+
user_input = input("Please Input an word:")
5+
6+
for word in words:
7+
user_input = user_input.replace(word, "*" * len(word))
8+
9+
print(user_input)

PyBeaner/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)