diff --git a/count_word.py b/count_word.py index e69de29..686fba1 100644 --- a/count_word.py +++ b/count_word.py @@ -0,0 +1,10 @@ +def countWord(file,word): + ans=[] + with open(file,"r") as f: + for i in f.readlines(): + ans.extend(i.split()) + count=0 + for i in range(len(ans)): + if(ans[i]==word): + count+=1 + return count diff --git a/count_word.pyc b/count_word.pyc new file mode 100644 index 0000000..d6a6db9 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..b0ec413 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..9cd0bf2 Binary files /dev/null and b/tests/test_countWord.pyc differ