Word Frequency
Medium · 50 XPPrint the three most common words in the starter text, one per line as word count.
Target output
the 4 and 3 fox 2
Blank · autosaved
PYword-frequency.py
Counter(text.split()).most_common(3)
from collections import Counter
text = "the quick fox and the lazy dog and the sleepy cat and the fox"
for word, count in Counter(text.split()).most_common(3):
print(word, count)
Run your code to check it…