Project
Word statistics
Analyse a sentence: count words, find the longest word and the most common word.
- Read one line of text and print
Words:followed by the number of words in it. - Add a line
Longest:followed by the longest word. If several words have the same length, use the first one. - Count how often each word appears using a dictionary, and add a line
Most common:followed by the most frequent word (the first one to reach the highest count if there is a tie). Treat words in lowercase.
Line 1, column 1Tab indents 4 spaces. Press Esc then Tab to leave the editor.