SoFunction
Updated on 2024-11-14

Butong Python code for counting the number of words in English.


# -*- coding: utf-8 -*-

import os,sys
info = () #Get the name of the current file
fin = open(u'Google C++ Programming Code Specification.txt')

info = ()
alist = (' ') # Split articles by spaces

fout = open(u'', 'w')
('\n'.join(alist)) # You can see the same effect by the line number of the text file
##('%s' % alist)
()

allen = len(alist) # total number of words
nulen = ('') # number of spaces
print "words' number is",allen
print "null number is",nulen
print "poor words number is", allen-nulen # actual number of words

()