I'm trying to count the frequency in which a word is used. If I say "hi im Nick" it will give me one count for each word. I followed the book but when I do something like "i am high as a kite" I get 3 counts for i and a. Is there a way to only count i and a by themselves?
txt = "i am high as a kite"
x = txt.split(" ")
for num_of_instances in x:
count = txt.count(num_of_instances)
print(num_of_instances, count)