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
Get step-by-step solutions from verified subject matter experts
