diff --git a/count_word.py b/count_word.py index e69de29..4c2a68b 100644 --- a/count_word.py +++ b/count_word.py @@ -0,0 +1,8 @@ +def countWord(filename,word): + count = 0 + word_occurance = open(filename,'r') + for line in word_occurance: + if word in line: + count+=1 + word_occurance.close() + return count diff --git a/count_word.pyc b/count_word.pyc new file mode 100644 index 0000000..cd0c570 Binary files /dev/null and b/count_word.pyc differ diff --git a/tests/__init__.pyc b/tests/__init__.pyc new file mode 100644 index 0000000..5f18b74 Binary files /dev/null and b/tests/__init__.pyc differ diff --git a/tests/test_countWord.pyc b/tests/test_countWord.pyc new file mode 100644 index 0000000..6f25f6b Binary files /dev/null and b/tests/test_countWord.pyc differ