I have a string \"Hello I am going to I with hello am\". I want to find how many times a word occur in the string. Example hello occurs 2 time. I tried this app
Hello I am going to I with hello am
Counter from collections is your friend:
>>> from collections import Counter >>> counts = Counter(sentence.lower().split())