Question: I'm creating this program in Python that reads a .txt file, converts the contents to lower case, and prints an alphabetized table of all the
I'm creating this program in Python that reads a .txt file, converts the contents to lower case, and prints an alphabetized table of all the different words in the file while showing how many times each word appears in the file.
But I'm having trouble alphabetizing the words. How do I do this?

f - open( "/Users/admin/Desktop/doves.txt""r) countWord = {} for word in f.read().split(): lowerCaseWord = word.lower() if lowerCaseWord not in countWord: countWord [lowerCaseWoraj - 1 else: countWord[lowerCaseWord] - countWord[ lowerCaseWord] + 1 for key,value in countWord.items (): print (key, value) ('kiss', 1) ('just', ("don't", 6) ('satisfied', 3) ( 'touch', ('father', 3) ("pride', 1) ('mother)', 1) ("you've", 1) ('they', 1) ('world', 4) ('pose
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
