File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
exercises/41-frequency-of-words Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 22
33## 📝 Instructions:
44
5- 1 . Write a program to compute the frequency of the words from the input. The output should output after sorting the key alphanumerically.
5+ 1 . Write a function called ` compute_word_frequency() ` to compute the frequency of the words from a string input.
6+
7+ 2 . Put each word separated by a space in a dictionary and count its frequency.
8+
9+ 3 . Sort the dictionary alphanumerically and print in the console each key in a new line.
610
711## 📎 Example input:
812
1216
1317## 📎 Example output:
1418
15- ``` py
19+ ``` text
16202: 2
17213.: 1
18223?: 1
@@ -25,3 +29,7 @@ choosing: 1
2529or: 2
2630to: 1
2731```
32+
33+ ## 💡 Hint:
34+
35+ + You can put each word of a string in a list with the ` split() ` method, then it is easier to work on it.
You can’t perform that action at this time.
0 commit comments