summaryrefslogtreecommitdiff
path: root/wordle.py
blob: 17d19d2ef59e160cd3bed4325647f2949a3f352f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import sys
import operator

text = '';
for line in sys.stdin:
    text += line;

words = text.split();
count = dict();

for w in words:
    if not w.isalpha(): continue;
    if w in count:
        count[w] += 1;
    else:
        count[w] = 1;

for w in sorted(count.items(), key=operator.itemgetter(1)):
    print(w);