Question: Python 3 only please. Write a Python program to count the occurrences of each word in a given sentence. For this assignment, please submit your

Python 3 only please. Write a Python program to count the occurrences of each word in a given sentence. For this assignment, please submit your source code (.py) file. First, your program will allow a user to input a text string. Second, your program should change each word in the sentence to lowercase. Third, your program should then split the text string into words and to count the occurrences of each of the words. Finally, display a list of these words back to the monitor with the number of times each word occurred in the string. Here is an example input: Input a text string: the quick brown fox likes the brown dog Output: {'quick' : 1, 'brown' : 2, 'fox' : 1 'the' : 2, 'dog' : 1, 'likes': 1}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!