Advertisement
ForestFox

Untitled

Dec 16th, 2021
1,161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | None | 0 0
  1. import re
  2. with open('revisor.txt') as f:
  3.     words = set()
  4.     for i in f:
  5.         b = re.split(r'\W+', i.lower())
  6.         words.update(b)
  7. words.remove('')
  8. words.remove('1851')
  9. words = sorted(words)
  10. words = sorted(words, key=lambda x: len(x))
  11. print(words)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement