if __name__ == '__main__':
    f = open('1.txt')
c = w = 0
s = 1
prevIsSentence = False
for x in f:
    x = x.strip()
if x != '':
    words = x.split()
w = w + len(words)
c = c + sum([len(word) for word in words])
prevIsSentence = True
How do the count the number of sentences, words and characters in a file?