-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path11(1).py
More file actions
34 lines (30 loc) · 771 Bytes
/
11(1).py
File metadata and controls
34 lines (30 loc) · 771 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
def read_file():
with open('filtered_words.txt', 'r') as file:
words = []
# words = file.readlines()
for word in file.readlines():
# word = word.replace('\n', '')
word = str.replace(word, '\n', '')
words.append(word)
print(words)
print(len(words))
return words
def de_word(words):
flag = False
new_word = input('请输入内容:')
print(new_word)
for word in words:
if word in new_word:
flag = True
print(flag)
break
else:
print(flag)
continue
if flag:
print('Freedom')
else:
print('Human Rights')
if __name__ == '__main__':
# read_file()
de_word(read_file())