diff --git a/count_word.py b/count_word.py index e69de29..5008aee 100644 --- a/count_word.py +++ b/count_word.py @@ -0,0 +1,10 @@ +def countWord(pth,target): + cnt = 0 + f = open(pth,"r") + for line in f: + if target in line: + cnt+=1 + return cnt + + +countWord('files/testfile.txt','Lorem') diff --git a/count_word.pyc b/count_word.pyc new file mode 100644 index 0000000..9188198 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..10a129d 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..d3e161d Binary files /dev/null and b/tests/test_countWord.pyc differ