I'm writing a code that takes user input and counts how many times a word shows up. I need to use a dictionary because this is a school assignment.
if I had the user input something like:
"a turtle on a fence had help"
then the output would be:
{'a': 2, 'turtle': 1, 'on': 1, 'fence': 1, 'had': 1, 'help': 1}
I know that I need to add the word to the dictionary, and if it's not in there in the first place, to make the value 1. I also know that if it's in there that I need to increment the value by 1 every time after it shows up. I'm just not totally sure how to execute that process.