diff --git a/hooting/0011/0011.py b/hooting/0011/0011.py new file mode 100644 index 00000000..b9ca6211 --- /dev/null +++ b/hooting/0011/0011.py @@ -0,0 +1,13 @@ +# -*- coding: utf-8 -*- +__author__ = 'hooting' +with open('filtered_words.txt','r')as f: + filter = [line.rstrip() for line in f] + +while True: + text = raw_input("please input:") + for x in filter: + if x in text: + print "Freedom" + break + else: + print "Human Rights" diff --git a/hooting/0011/filtered_words.txt b/hooting/0011/filtered_words.txt new file mode 100644 index 00000000..69373b64 --- /dev/null +++ b/hooting/0011/filtered_words.txt @@ -0,0 +1,11 @@ +北京 +程序员 +公务员 +领导 +牛比 +牛逼 +你娘 +你妈 +love +sex +jiangge \ No newline at end of file diff --git a/hooting/0012/0012.py b/hooting/0012/0012.py new file mode 100644 index 00000000..4cb26925 --- /dev/null +++ b/hooting/0012/0012.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +__author__ = 'hooting' +with open('filtered_words.txt','r')as f: + filter = [line.rstrip() for line in f] + +while True: + text = raw_input("please input:") + for x in filter: + if x in text: + print len(x) + text = text.replace(x, '*'*len(x)) + print text diff --git a/hooting/0012/filtered_words.txt b/hooting/0012/filtered_words.txt new file mode 100644 index 00000000..69373b64 --- /dev/null +++ b/hooting/0012/filtered_words.txt @@ -0,0 +1,11 @@ +北京 +程序员 +公务员 +领导 +牛比 +牛逼 +你娘 +你妈 +love +sex +jiangge \ No newline at end of file