Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Veedrac
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
164 ms
·
1651.
▲
by
Veedrac
12y ago
No need for `invert_dict`; you're just counting so `collections.Counter` would work fine: from collections import Counter with open('data.txt', 'r') as datafile: students = dict(line.rsplit(maxspl