Advertisement
Taigar2000

Частотный анализ

Dec 19th, 2020 (edited)
690
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  1. f = open('input.txt')
  2. res = {}
  3. for i in f:
  4.     s = i.split()
  5.     for j in s:
  6.         res[j] = res.setdefault(j, 0)+1
  7. r = list(res.items())
  8. r.sort(key=lambda x: (-x[1],x[0]))
  9. for i in r:
  10.     print(i[0])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement