12 lines
218 B
Python
12 lines
218 B
Python
import collections
|
|
|
|
|
|
def check(line, name):
|
|
cnt = collections.Counter(line.lower().split())
|
|
|
|
with open(name, "w") as f:
|
|
for word in sorted(cnt):
|
|
f.write(f"{word} {cnt[word]}\n")
|
|
|
|
return
|