13 lines
249 B
Python
13 lines
249 B
Python
from collections import Counter
|
|
|
|
|
|
def check(line, file):
|
|
words = line.lower().split(" ")
|
|
counter = Counter(words)
|
|
|
|
with open(file, "w") as file:
|
|
for i in sorted(counter):
|
|
file.write(f"{i} {counter[i]}\n")
|
|
|
|
return
|