Python Assignment

Posted : 11 months ago

Write a python program that accepts a text file as input. The program should read the text file and display all unique words in alphabetical order.  It should then display the non-unique words and the number of times that they occurred in the input text.

Input file contains the following text:

how much wood would a woodchuck chuck if a woodchuck could chuck wood

Expected outcome should resemble:


Non-unique words and number of occurrences in no particular order:
wood : 2
a : 2
woodchuck : 2
chuck : 2
Unique words in alphabetic order:

Files Attached

No files attached