Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Counter solution in Clear category for Popular Words by rossras
from collections import Counter
def popular_words(text: str, words: list) -> dict:
word_counts = Counter(text.lower().split())
return {word: word_counts[word] for word in words}
April 3, 2020