Write a program that counts how often each word occurs in


PYTHON programming, please!

Write a program that counts how often each word occurs in the supplied text file mary.txt.

Your program should output one line for each unique word that occurs in the text file in the format word: count, where word is a word from the file and count is the number of times that word occurs.

Be sure to strip punctuation from words or your program will won't produce the correct output.

(Hint : The dictionary data structure should be used for this problem)

mary.txt is the following

Mary had a little lamb, whose fleece was white as snow. And everywhere that Mary went, the lamb was sure to go. It followed her to school one day which was against the rules.

It made the children laugh and play, to see a lamb at school. And so the teacher turned it out, but still it lingered near, And waited patiently about, till Mary did appear. "Why does the lamb love Mary so?" the eager children cry. "Why, Mary loves the lamb, you know." the teacher did reply.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Write a program that counts how often each word occurs in
Reference No:- TGS02907036

Expected delivery within 24 Hours