I'm having a tough time figuring this out.
we need to fill in the blanks
import ____________
def wordCount():
lineCnt = 0
wordCnt = 0
charCnt = 0
list = []
______________ = _______________("Enter the filename : ")
file = ________(filename, __________)
for _________ in file:
____________ += 1
list = string.____________(line, ' ')
wordCnt = wordCnt + len(_________)
for ch in _________:
____________ += 1
print ___________, "lines"
print ___________, "words"
print ___________, "characters"
file.____________()
wordCount()
this is what I have gotten so far.
import string
def wordCount():
lineCnt = 0
wordCnt = 0
charCnt = 0
list = []
file = raw_input("Enter the filename : ")
file = ________(filename, file)
for range in file:
lineCnt += 1
list = string.____________(line, ' ')
wordCnt = wordCnt + len(_________)
for ch in file:
charCnt += 1
print lineCnt, "lines"
print wordCnt, "words"
print charCnt, "characters"
file.____________()
wordCount()
Thanks in advance