diff --git a/count_word.py b/count_word.py index e69de29..d5f6476 100644 --- a/count_word.py +++ b/count_word.py @@ -0,0 +1,8 @@ +def countWord(filename,word): + count = 0 + f = open(filename,'r') + for line in f: + if word in line: + count+=1 + f.close() + return count diff --git a/count_word.pyc b/count_word.pyc new file mode 100644 index 0000000..f8b8f22 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..c25ed06 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..eec2a00 Binary files /dev/null and b/tests/test_countWord.pyc differ