Home My space log
Language EN (English)

Count the words

Python Intermediate alien ages 11-13

The problem

Write a function word_count(text). It gives back a dictionary that says how many times each word appears. Ignore capital letters: Go and go are the same word. Words are separated by spaces. Example: word_count("the cat the") gives {"the": 2, "cat": 1}.

You will practice: dictionaries, loops, split, lower case

Mode

Press Tab to indent. Press Esc and then Tab to move on to the next button.

Your code runs in your browser. We do not receive it or save it. Python is downloaded from cdn.jsdelivr.net the first time you run it (about 10 MB).

Test results

      What your code printed