Advertisement
ForestFox

Untitled

Nov 26th, 2021
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. with open('file.txt') as f:
  2. a = f.read()
  3. a = a.replace('\n', '').replace('.', ' ')
  4. a = a.lower().split()
  5.  
  6. aa = []
  7. for j in a:
  8. sl = ''
  9. count_aa = 0
  10. for i in j:
  11. if i.isalpha():
  12. sl += i
  13. count_aa += (i == 'a')
  14. if count_aa >= 2:
  15. if sl not in aa:
  16. aa += [sl]
  17.  
  18. print(*sorted(aa))
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement