Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def wordCount(filename):
- fopen = open(filename, "r")
- count = 0
- for line in fopen:
- for ch in line:
- if (ch == " "):
- count = count + 1
- fopen.close()
- return count
- print (wordCount("dracula.txt"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement