Skip to content

Commit 255205e

Browse files
authored
Update README.md
1 parent bda5448 commit 255205e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

exercises/41-frequency-of-words/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
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

@@ -12,7 +16,7 @@
1216

1317
## 📎 Example output:
1418

15-
```py
19+
```text
1620
2: 2
1721
3.: 1
1822
3?: 1
@@ -25,3 +29,7 @@ choosing: 1
2529
or: 2
2630
to: 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.

0 commit comments

Comments
 (0)