Python programming: how do I count space-seperated words in a given file?

pcm

New member
the function should start like this:
def count_words_in_file(filename):

It should work like this:
>>> count_words_in_file('mary.txt')
39
 
Back
Top