A program that opens a text file, counts the number of words and reports the top N words ordered by the number of times they appear in the file?
问题 Hi all im a beginner at programming, i was recently given the task of creating this program and i am finding it difficult. I have previously designed a program that calculates the number of words in a sentence that are typed in by the user, is it possible to modify this program to achieve what i want? import string def main(): print "This program calculates the number of words in a sentence" print p = raw_input("Enter a sentence: ") words = string.split(p) wordCount = len(words) print "The