Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Second: one-liner, creating the dict on the fly solution in Clear category for Popular Words by leggewie
# one-liner, creating the dict on the fly
def popular_words(text: str, words: list) -> dict:
return {word:text.lower().split().count(word) for word in words}
May 26, 2021
Comments: