Objective
Create a Python program that counts how many times each word of a text appears using a dictionary.
Instructions
- Read a line of text with words separated by spaces, without punctuation marks.
- Convert the text to lower case so that
Sunandsuncount as the same word. - Store in a dictionary each word and the number of times it appears.
- Show one line per word, sorted alphabetically, with the format
word: times.
el sol y la luna y el mar
el: 2
la: 1
luna: 1
mar: 1
sol: 1
y: 2
Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.
Start exercise