Question: HW - Dictionary Your program is supposed to do the following: -Input: the user enters a line of texts -What it does: build a

HW-Dictionary Your program is supposed to do the following: -Input: the user enters a line of texts -What itRequirement/restriction: Do NOT use the get method provided by dictionary. For example, counts.get(name,0)

HW - Dictionary Your program is supposed to do the following: -Input: the user enters a line of texts -What it does: build a histogram of the words in the line of texts. -Output: 1. the histogram of the words 2. The most frequently used word Sample output: C:/Users/Owner1/Documents/ABC-Python/ ======= RESTART: Enter a line of text cat hi cat hi cat hi red blue red Counts ('cat': 3, 'hi': 3, 'red': 2, 'blue': 1} The most frequently used word and # of frequency: The most frequently used word and # of frequency: hi 3 >>> | cat 3 For the test case, make sure to use the following test case: fish fish cat cat fish cat blue red blue www. Requirement/restriction: Do NOT use the get method provided by dictionary. For example, counts.get(name,0) should be used (watch the part 2 video lecture @6:22). As shown in the part2 lecture video, use the if-else statement (part2 video lecture @6:22) for counting words.

Step by Step Solution

3.40 Rating (153 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Python version 38 prompt and read a line as string line inputEnter a line of te... View full answer

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 Programming Questions!