Question: This is for an Intro to Python class: Write a function called word_count that has a string as a parameter and returns a dictionary with

This is for an Intro to Python class:

Write a function called word_count that has a string as a parameter and returns a dictionary with the word counts from the string.

Suppose you call your function like this:

print(word_count('hi hello hello hi howdy'))

This should output:

{'hi': 2, 'hello': 2, 'howdy': 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!