Advertisement
Guest User

Untitled

a guest
Apr 15th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. dict = {}
  2. listd = []
  3. text = open("ajto.txt","r")
  4. for line in text:
  5.     line = line.strip().split(" ")
  6.     listd.append(line[2])
  7.     dict.update({line[2] : listd.count(line[2])})
  8.  
  9. file = open("athaladas.txt","w")
  10. for k, v in sorted(dict.items()):
  11.     file.write('{} {}\n'.format(k, v))
  12.  
  13. text.close()
  14. file.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement